Enable offline builds (#2087)

This commit is contained in:
Jonah Aragon 2023-03-11 13:29:07 -06:00
parent c99bdda06f
commit 9112720140
No known key found for this signature in database
5 changed files with 203 additions and 14 deletions

View File

@ -23,8 +23,6 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
fetch-depth: '0' fetch-depth: '0'
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
ssh-key: ${{ secrets.ACTIONS_SSH_KEY }} ssh-key: ${{ secrets.ACTIONS_SSH_KEY }}
submodules: 'true' submodules: 'true'
@ -56,14 +54,7 @@ jobs:
pipenv run mkdocs build --config-file config/mkdocs.fr.yml pipenv run mkdocs build --config-file config/mkdocs.fr.yml
pipenv run mkdocs build --config-file config/mkdocs.he.yml pipenv run mkdocs build --config-file config/mkdocs.he.yml
pipenv run mkdocs build --config-file config/mkdocs.nl.yml pipenv run mkdocs build --config-file config/mkdocs.nl.yml
mv .well-known site/
pipenv run mkdocs --version pipenv run mkdocs --version
- name: Matrix homeserver configuration
run: |
mkdir -p site/.well-known/matrix
curl -o site/.well-known/matrix/server https://matrix.privacyguides.org/.well-known/matrix/server
curl -o site/.well-known/matrix/client https://matrix.privacyguides.org/.well-known/matrix/client
- name: Package website - name: Package website
uses: actions/upload-pages-artifact@v1 uses: actions/upload-pages-artifact@v1

View File

@ -6,14 +6,67 @@ on:
- '*' - '*'
jobs: jobs:
release: build:
name: Create Release name: Create Release
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: write contents: write
steps: steps:
- uses: actions/checkout@v3 - name: Checkout repository
- uses: ncipollo/release-action@v1 uses: actions/checkout@v3
with:
fetch-depth: '0'
ssh-key: ${{ secrets.ACTIONS_SSH_KEY }}
submodules: 'true'
- name: Pages setup
uses: actions/configure-pages@v3
- name: Python setup
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Cache files
uses: actions/cache@v3.3.0
with:
key: ${{ github.ref }}
path: .cache
- name: Install Python dependencies
run: |
pip install pipenv
pipenv install
- name: Build website
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARDS: true
run: |
pipenv run mkdocs build --config-file config/mkdocs.offline.yml
pipenv run mkdocs --version
- name: Package website
run: |
tar -czvf offline.tar.gz site
zip -r -q offline.zip site
- name: Upload tar.gz file
uses: actions/upload-artifact@v3
with:
name: offline.tar.gz
path: offline.tar.gz
- name: Upload zip file
uses: actions/upload-artifact@v3
with:
name: offline.zip
path: offline.zip
- name: Create release notes
uses: ncipollo/release-action@v1
with: with:
generateReleaseNotes: true generateReleaseNotes: true
token: ${{ secrets.REPO_TOKEN }} token: ${{ secrets.REPO_TOKEN }}
artifacts: "offline.zip,offline.tar.gz"

139
config/mkdocs.offline.yml Normal file
View File

@ -0,0 +1,139 @@
INHERIT: mkdocs.common.yml
docs_dir: '../docs'
site_url: "https://www.privacyguides.org/"
site_dir: '../site'
site_name: Privacy Guides
site_description: |
Privacy Guides is your central privacy and security resource to protect yourself online.
copyright: |
<b>Privacy Guides</b> is a non-profit, socially motivated website that provides information for protecting your data security and privacy.<br>
We do not make money from recommending certain products, and we do not use affiliate links.<br>
&copy; 2022 Privacy Guides and contributors.
<span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m245.83 214.87-33.22 17.28c-9.43-19.58-25.24-19.93-27.46-19.93-22.13 0-33.22 14.61-33.22 43.84 0 23.57 9.21 43.84 33.22 43.84 14.47 0 24.65-7.09 30.57-21.26l30.55 15.5c-6.17 11.51-25.69 38.98-65.1 38.98-22.6 0-73.96-10.32-73.96-77.05 0-58.69 43-77.06 72.63-77.06 30.72-.01 52.7 11.95 65.99 35.86zm143.05 0-32.78 17.28c-9.5-19.77-25.72-19.93-27.9-19.93-22.14 0-33.22 14.61-33.22 43.84 0 23.55 9.23 43.84 33.22 43.84 14.45 0 24.65-7.09 30.54-21.26l31 15.5c-2.1 3.75-21.39 38.98-65.09 38.98-22.69 0-73.96-9.87-73.96-77.05 0-58.67 42.97-77.06 72.63-77.06 30.71-.01 52.58 11.95 65.56 35.86zM247.56 8.05C104.74 8.05 0 123.11 0 256.05c0 138.49 113.6 248 247.56 248 129.93 0 248.44-100.87 248.44-248 0-137.87-106.62-248-248.44-248zm.87 450.81c-112.54 0-203.7-93.04-203.7-202.81 0-105.42 85.43-203.27 203.72-203.27 112.53 0 202.82 89.46 202.82 203.26-.01 121.69-99.68 202.82-202.84 202.82z"></path></svg></span><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M314.9 194.4v101.4h-28.3v120.5h-77.1V295.9h-28.3V194.4c0-4.4 1.6-8.2 4.6-11.3 3.1-3.1 6.9-4.7 11.3-4.7H299c4.1 0 7.8 1.6 11.1 4.7 3.1 3.2 4.8 6.9 4.8 11.3zm-101.5-63.7c0-23.3 11.5-35 34.5-35s34.5 11.7 34.5 35c0 23-11.5 34.5-34.5 34.5s-34.5-11.5-34.5-34.5zM247.6 8C389.4 8 496 118.1 496 256c0 147.1-118.5 248-248.4 248C113.6 504 0 394.5 0 256 0 123.1 104.7 8 247.6 8zm.8 44.7C130.2 52.7 44.7 150.6 44.7 256c0 109.8 91.2 202.8 203.7 202.8 103.2 0 202.8-81.1 202.8-202.8.1-113.8-90.2-203.3-202.8-203.3z"></path></svg></span><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M247.6 8C389.4 8 496 118.1 496 256c0 147.1-118.5 248-248.4 248C113.6 504 0 394.5 0 256 0 123.1 104.7 8 247.6 8zm.8 44.7C130.2 52.7 44.7 150.6 44.7 256c0 109.8 91.2 202.8 203.7 202.8 103.2 0 202.8-81.1 202.8-202.8.1-113.8-90.2-203.3-202.8-203.3zm94 144.3v42.5H162.1V197h180.3zm0 79.8v42.5H162.1v-42.5h180.3z"></path></svg></span>
Content licensed under <a href="/about/"><strong>CC BY-ND 4.0</strong></a>.
repo_url: ""
extra:
generator: false
analytics: false
alternate: false
offline: true
theme:
language: en
logo: ../theme/assets/brand/SVG/Logo/privacy-guides-logo-notext-colorbg.svg
font:
text: Public Sans
code: DM Mono
palette:
- media: "(prefers-color-scheme)"
scheme: default
accent: deep purple
toggle:
icon: material/brightness-auto
name: "Switch to dark mode"
- media: "(prefers-color-scheme: dark)"
scheme: slate
accent: amber
toggle:
icon: material/brightness-2
name: "Switch to light mode"
- media: "(prefers-color-scheme: light)"
scheme: default
accent: deep purple
toggle:
icon: material/brightness-5
name: "Switch to system theme"
features:
- navigation.tabs
- navigation.sections
- navigation.indexes
- content.tooltips
- search.highlight
plugins:
offline:
enabled: true
markdown_extensions:
pymdownx.snippets:
auto_append:
- includes/abbreviations.en.txt
nav:
- Home: 'index.md'
- Knowledge Base:
- 'basics/threat-modeling.md'
- 'basics/common-threats.md'
- 'basics/common-misconceptions.md'
- 'basics/account-creation.md'
- 'basics/account-deletion.md'
- Technology Essentials:
- 'basics/passwords-overview.md'
- 'basics/multi-factor-authentication.md'
- 'basics/email-security.md'
- 'basics/vpn-overview.md'
- Operating Systems:
- 'os/android-overview.md'
- 'os/linux-overview.md'
- 'os/qubes-overview.md'
- Advanced Topics:
- 'advanced/dns-overview.md'
- 'advanced/tor-overview.md'
- 'advanced/payments.md'
- 'advanced/communication-network-types.md'
- kb-archive.md
- Recommendations:
- 'tools.md'
- Internet Browsing:
- 'tor.md'
- 'desktop-browsers.md'
- 'mobile-browsers.md'
- Operating Systems:
- 'android.md'
- 'desktop.md'
- 'router.md'
- Providers:
- 'cloud.md'
- 'dns.md'
- 'email.md'
- 'financial-services.md'
- 'search-engines.md'
- 'vpn.md'
- Software:
- 'calendar.md'
- 'cryptocurrency.md'
- 'data-redaction.md'
- 'email-clients.md'
- 'encryption.md'
- 'file-sharing.md'
- 'frontends.md'
- 'multi-factor-authentication.md'
- 'news-aggregators.md'
- 'notebooks.md'
- 'passwords.md'
- 'productivity.md'
- 'real-time-communication.md'
- 'video-streaming.md'
- About:
- 'about/index.md'
- 'about/criteria.md'
- 'about/statistics.md'
- 'about/notices.md'
- 'about/privacy-policy.md'
- Community:
- 'about/donate.md'
- Online Services: 'about/services.md'
- Code of Conduct: 'CODE_OF_CONDUCT.md'
- 'about/privacytools.md'
- Contributing:
- Writing Guide:
- 'meta/writing-style.md'
- 'meta/brand.md'
- Technical Guides:
- 'meta/uploading-images.md'
- 'meta/git-recommendations.md'
- Changelog: 'https://github.com/privacyguides/privacyguides.org/releases'
- Forum: 'https://discuss.privacyguides.net/'
- Blog: 'https://blog.privacyguides.org/'

View File

@ -33,3 +33,9 @@
<link rel="icon" href="{{ config.theme.favicon | url }}"> <link rel="icon" href="{{ config.theme.favicon | url }}">
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-9.1.0+insiders-4.32.2"> <meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-9.1.0+insiders-4.32.2">
{% endblock %} {% endblock %}
{% block announce %}{% if config.extra.offline %}
You're viewing an offline copy of Privacy Guides built on {{ build_date_utc }}.
<a href="https://www.privacyguides.org/">
<strong>Visit privacyguides.org for the latest version.</strong>
</a>
{% else %}{% endif %}{% endblock %}

View File

@ -12,10 +12,10 @@
<div class="mdx-hero__content"> <div class="mdx-hero__content">
<h1>The guide to restoring your online privacy.</h1> <h1>The guide to restoring your online privacy.</h1>
<p>Massive organizations are monitoring your online activities. Privacy Guides is your central privacy and security resource to protect yourself online.</p> <p>Massive organizations are monitoring your online activities. Privacy Guides is your central privacy and security resource to protect yourself online.</p>
<a href="kb/" title="The first step of your privacy journey" class="md-button md-button--primary"> <a href="{% if config.extra.offline %}basics/threat-modeling.html{% else %}kb/{% endif %}" title="The first step of your privacy journey" class="md-button md-button--primary">
Start Your Privacy Journey Start Your Privacy Journey
</a> </a>
<a href="tools/" title="Recommended privacy tools, services, and knowledge" class="md-button"> <a href="{% if config.extra.offline %}tools.html{% else %}tools/{% endif %}" title="Recommended privacy tools, services, and knowledge" class="md-button">
Recommended Tools Recommended Tools
</a> </a>
</div> </div>