Remove per-language config files (#2513)

This commit is contained in:
Jonah Aragon 2024-04-10 15:18:32 -05:00
parent 1acdf1748f
commit 775ff52b14
No known key found for this signature in database
27 changed files with 468 additions and 527 deletions

1
.cache/plugin/social/fonts Symbolic link
View File

@ -0,0 +1 @@
../../../theme/assets/brand/fonts

View File

@ -4,5 +4,5 @@
"name": "Privacy Guides", "name": "Privacy Guides",
"image": "ghcr.io/squidfunk/mkdocs-material:9.5.17", "image": "ghcr.io/squidfunk/mkdocs-material:9.5.17",
"forwardPorts": [8000], "forwardPorts": [8000],
"postCreateCommand": "git submodule init; git submodule update theme/assets/brand; mkdocs serve --dev-addr=0.0.0.0:8000 --config-file config/mkdocs.en.yml" "postCreateCommand": "git submodule init; git submodule update theme/assets/brand; mkdocs serve --dev-addr=0.0.0.0:8000"
} }

View File

@ -4,5 +4,5 @@
"name": "Privacy Guides Team", "name": "Privacy Guides Team",
"image": "ghcr.io/privacyguides/privacyguides.org:main", "image": "ghcr.io/privacyguides/privacyguides.org:main",
"forwardPorts": [8000], "forwardPorts": [8000],
"postCreateCommand": "git submodule init; git submodule update theme/assets/brand; MKDOCS_INHERIT=mkdocs-production.yml mkdocs serve --dev-addr=0.0.0.0:8000 --config-file config/mkdocs.en.yml" "postCreateCommand": "git submodule init; git submodule update theme/assets/brand; mkdocs serve --dev-addr=0.0.0.0:8000 --config-file mkdocs-production.yml"
} }

View File

@ -1,4 +1,3 @@
#
name: ☁️ Build Container name: ☁️ Build Container
# Configures this workflow to run every time a change is pushed to the branch called `release`. # Configures this workflow to run every time a change is pushed to the branch called `release`.

116
.github/workflows/build-pr.yml vendored Normal file
View File

@ -0,0 +1,116 @@
name: 🛠️ Build PR Preview
on:
pull_request:
concurrency:
group: ${{github.event.pull_request.head.ref}}
cancel-in-progress: true
permissions:
contents: read
jobs:
metadata:
runs-on: ubuntu-latest
outputs:
submodules: ${{ steps.submodules-fork.outputs.submodules || steps.submodules-main.outputs.submodules }}
privileged: ${{ steps.submodules-fork.outputs.privileged || steps.submodules-main.outputs.privileged }}
env:
ACTIONS_SSH_KEY: ${{ secrets.ACTIONS_SSH_KEY }}
steps:
- name: Set submodules for fork
if: env.ACTIONS_SSH_KEY == ''
id: submodules-fork
run: |
echo 'submodules={"repo":["brand","i18n"]}' >> "$GITHUB_OUTPUT"
echo "privileged=false" >> "$GITHUB_OUTPUT"
- name: Set submodules for main repo
if: env.ACTIONS_SSH_KEY != ''
id: submodules-main
run: |
echo 'submodules={"repo":["brand","i18n","mkdocs-material-insiders"]}' >> "$GITHUB_OUTPUT"
echo "privileged=true" >> "$GITHUB_OUTPUT"
- name: Save PR metadata
run: |
mkdir -p ./metadata
echo ${{ github.event.number }} > ./metadata/NR
echo ${{ github.event.pull_request.head.sha }} > ./metadata/SHA
- name: Upload metadata as artifact
uses: actions/upload-artifact@v4
with:
name: metadata
path: metadata
submodule:
needs: metadata
strategy:
matrix: ${{ fromJson(needs.metadata.outputs.submodules) }}
uses: privacyguides/.github/.github/workflows/download-repo.yml@main
with:
repo: ${{ matrix.repo }}
privileged: ${{ fromJSON(needs.metadata.outputs.privileged) }}
secrets:
ACTIONS_SSH_KEY: ${{ secrets.ACTIONS_SSH_KEY }}
build_english:
needs: [submodule, metadata]
strategy:
matrix:
lang: [en]
fail-fast: true
uses: ./.github/workflows/build.yml
with:
ref: ${{github.event.pull_request.head.ref}}
repo: ${{github.event.pull_request.head.repo.full_name}}
lang: en
continue-on-error: false
privileged: ${{ fromJSON(needs.metadata.outputs.privileged) }}
build_i18n:
if: ${{ contains(github.event.pull_request.labels.*.name, 'ci:build i18n') }}
needs: [submodule, metadata]
strategy:
matrix:
lang: [es, fr, he, it, nl, ru, zh-Hant]
fail-fast: false
uses: ./.github/workflows/build.yml
with:
ref: ${{github.event.pull_request.head.ref}}
repo: ${{github.event.pull_request.head.repo.full_name}}
lang: ${{ matrix.lang }}
continue-on-error: true
privileged: ${{ fromJSON(needs.metadata.outputs.privileged) }}
combine_build:
needs: [build_english, build_i18n]
if: |
(always() && !cancelled() && !failure()) &&
needs.build_english.result == 'success' &&
(needs.build_i18n.result == 'success' || needs.build_i18n.result == 'skipped')
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: site-build-*
merge-multiple: true
- run: |
for file in *.tar.gz; do tar -zxf "$file"; done
ls -la site/
- name: Upload Site
uses: actions/upload-artifact@v4
with:
name: site-build-combined
path: site
retention-days: 5
cleanup:
if: ${{ always() }}
needs: [build_english, build_i18n]
uses: privacyguides/.github/.github/workflows/cleanup.yml@main

View File

@ -1,4 +1,4 @@
name: Build Website name: 🛠️ Build Website
on: on:
workflow_call: workflow_call:
@ -21,6 +21,9 @@ on:
continue-on-error: continue-on-error:
type: boolean type: boolean
default: true default: true
privileged:
type: boolean
default: true
permissions: permissions:
contents: read contents: read
@ -33,104 +36,242 @@ jobs:
contents: read contents: read
steps: steps:
- run: | - name: Add GitHub Token to Environment
run: |
echo "GH_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> "$GITHUB_ENV" echo "GH_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> "$GITHUB_ENV"
- if: inputs.config == 'build' - name: Set Metadata
if: inputs.config == 'build'
run: | run: |
{ {
echo "MKDOCS_INHERIT=mkdocs-production.yml" echo "BUILD_CONTEXT=${{ inputs.context }}"
echo "BUILD_EDIT_URI_TEMPLATE=blob/main/docs/{path}?plain=1"
echo "BUILD_REPO_URL=https://github.com/privacyguides/privacyguides.org"
echo "PRODUCTION=true" echo "PRODUCTION=true"
echo "CONTEXT=${{ inputs.context }}"
} >> "$GITHUB_ENV" } >> "$GITHUB_ENV"
- if: inputs.config == 'offline' - name: Set Metadata for Privileged Builds
run: | if: inputs.privileged
echo "MKDOCS_INHERIT=mkdocs-offline.yml" >> "$GITHUB_ENV" run: echo "BUILD_INSIDERS=true" >> "$GITHUB_ENV"
echo "CARDS=false" >> "$GITHUB_ENV"
- uses: actions/checkout@v4 - name: Set Metadata for Offline Mode
if: inputs.config == 'offline'
run: |
{
echo "BUILD_EDIT_URI_TEMPLATE=''"
echo "BUILD_OFFLINE=true"
echo "BUILD_REPO_URL=''"
echo "CARDS=false"
echo "HOMEPAGE_BUTTON_GET_STARTED_LINK=basics/why-privacy-matters.html"
echo "HOMEPAGE_BUTTON_TOOLS_LINK=tools.html"
} >> "$GITHUB_ENV"
- name: Set Metadata for Translations
if: inputs.lang != 'en'
run: |
{
echo "BUILD_ABBREVIATIONS=includes/abbreviations.${{ inputs.lang }}.txt"
echo "BUILD_DOCS_DIR=i18n/${{ inputs.lang }}"
echo "BUILD_EDIT_URI_TEMPLATE=https://github.com/privacyguides/i18n/blob/main/i18n/${{ inputs.lang }}/{path}?plain=1"
echo "BUILD_SITE_DIR=site/${{ inputs.lang }}"
echo "BUILD_SITE_URL=https://privacyguides.org/${{ inputs.lang }}"
echo "BUILD_THEME_LANGUAGE=${{ inputs.lang }}"
} >> "$GITHUB_ENV"
- name: Set Metadata for Hebrew Translation
if: inputs.lang == 'he'
run: |
{
echo "BUILD_THEME_FONT_CODE=Cousine"
echo "BUILD_THEME_FONT_TEXT=Open Sans"
echo "TRANSLATION_STYLESHEET=assets/stylesheets/lang-${{ inputs.lang }}.css?v=20240410"
} >> "$GITHUB_ENV"
- name: Set Metadata for Russian Translation
if: inputs.lang == 'ru'
run: |
{
echo "TRANSLATION_STYLESHEET=assets/stylesheets/lang-${{ inputs.lang }}.css?v=20240410"
} >> "$GITHUB_ENV"
- name: Set Metadata for Chinese (Traditional) Translation
if: inputs.lang == 'zh-Hant'
run: |
{
echo "BUILD_THEME_FONT_CODE=Noto Sans TC"
echo "BUILD_THEME_FONT_TEXT=Noto Sans TC"
echo "TRANSLATION_STYLESHEET=assets/stylesheets/lang-${{ inputs.lang }}.css?v=20240410"
} >> "$GITHUB_ENV"
- name: Download Repository
uses: actions/checkout@v4
with: with:
repository: ${{ inputs.repo }} repository: ${{ inputs.repo }}
ref: ${{ inputs.ref }} ref: ${{ inputs.ref }}
persist-credentials: "false" persist-credentials: "false"
fetch-depth: 0 fetch-depth: 0
- uses: actions/download-artifact@v4 - name: Download Submodules
uses: actions/download-artifact@v4
with: with:
pattern: repo-* pattern: repo-*
path: modules path: modules
- run: | - name: Move mkdocs-material-insiders to mkdocs-material
if: inputs.privileged
run: |
rmdir modules/mkdocs-material rmdir modules/mkdocs-material
mv modules/repo-mkdocs-material-insiders modules/mkdocs-material mv modules/repo-mkdocs-material-insiders modules/mkdocs-material
- name: Move brand submodule to theme/assets/brand
run: |
rmdir theme/assets/brand rmdir theme/assets/brand
mv modules/repo-brand theme/assets/brand mv modules/repo-brand theme/assets/brand
- if: inputs.lang != 'en' - name: Copy Translation Files
if: inputs.lang != 'en'
run: | run: |
cp -rl modules/repo-i18n/i18n . cp -rl modules/repo-i18n/i18n .
cp -rl modules/repo-i18n/includes . cp -rl modules/repo-i18n/includes .
cp -rl modules/repo-i18n/theme . cp -rl modules/repo-i18n/theme .
- uses: actions/setup-python@v5 - name: Install Python
uses: actions/setup-python@v5
with: with:
cache: "pipenv" cache: "pipenv"
- uses: actions/cache/restore@v4.0.2 - name: Restore Privacy Plugin Cache
id: site_cache_restore uses: actions/cache/restore@v4.0.2
id: privacy_cache_restore
with: with:
key: site-cache-${{ inputs.repo }}-${{ inputs.ref }}-${{ hashfiles('.cache/**') }} key: privacy-cache-${{ inputs.repo }}-${{ hashfiles('.cache/plugin/privacy/**') }}
path: .cache
restore-keys: |
site-cache-${{ inputs.repo }}-${{ inputs.ref }}-
site-cache-${{ inputs.repo }}-
- uses: actions/cache/restore@v4.0.2
id: card_cache_restore
with:
key: card-cache-${{ inputs.repo }}-${{ inputs.lang }}-${{ inputs.ref }}-${{ hashfiles('config/.cache/plugin/social/manifest.json') }}
path: | path: |
config/.cache/plugin/social/manifest.json .cache/plugin/privacy
config/.cache/plugin/social/assets
restore-keys: | restore-keys: |
card-cache-${{ inputs.repo }}-${{ inputs.lang }}-${{ inputs.ref }}- privacy-cache-${{ inputs.repo }}-
card-cache-${{ inputs.repo }}-${{ inputs.lang }}- privacy-cache-privacyguides/privacyguides.org-
privacy-cache-
- run: | - name: Restore Social Plugin Cache
uses: actions/cache/restore@v4.0.2
id: social_cache_restore
with:
key: social-cache-${{ inputs.repo }}-${{ inputs.lang }}-${{ hashfiles('.cache/plugin/social/manifest.json') }}
path: |
.cache/plugin/social/manifest.json
.cache/plugin/social/assets
restore-keys: |
social-cache-${{ inputs.repo }}-${{ inputs.lang }}-
social-cache-privacyguides/privacyguides.org-${{ inputs.lang }}-
- name: Restore Optimize Plugin Cache
uses: actions/cache/restore@v4.0.2
id: optimize_cache_restore
with:
key: optimize-cache-${{ inputs.repo }}-${{ hashfiles('.cache/plugin/optimize/manifest.json') }}
path: |
.cache/plugin/optimize
restore-keys: |
optimize-cache-${{ inputs.repo }}-
optimize-cache-privacyguides/privacyguides.org-
optimize-cache-
- name: Install Python Dependencies
if: inputs.privileged
run: |
pip install pipenv pip install pipenv
pipenv install pipenv install
sudo apt install pngquant sudo apt install pngquant
- uses: falti/dotenv-action@v1.1 - name: Install Python Dependencies (Unprivileged)
if: ${{ !inputs.privileged }}
run: |
pip install mkdocs-material
sudo apt install pngquant
- name: Set Translated String Environment Variables
uses: falti/dotenv-action@v1.1
with: with:
path: includes/strings.${{ inputs.lang }}.env path: includes/strings.${{ inputs.lang }}.env
export-variables: true export-variables: true
keys-case: bypass keys-case: bypass
- run: | - name: Build Website
pipenv run mkdocs build --config-file config/mkdocs.${{ inputs.lang }}.yml if: inputs.privileged
run: |
pipenv run mkdocs build --config-file mkdocs-production.yml
pipenv run mkdocs --version pipenv run mkdocs --version
tar -czvf site-${{ inputs.config }}-${{ inputs.lang }}.tar.gz site
- uses: actions/cache/save@v4.0.2 - name: Build Website (Unprivileged)
if: steps.site_cache_restore.outputs.cache-hit != 'true' if: ${{ !inputs.privileged }}
with: run: |
key: site-cache-${{ inputs.repo }}-${{ inputs.ref }}-${{ hashfiles('.cache/**') }} mkdocs build
path: .cache mkdocs --version
- uses: actions/cache/save@v4.0.2 - name: Package Website
if: steps.card_cache_restore.outputs.cache-hit != 'true' run: |
tar -czf site-${{ inputs.config }}-${{ inputs.lang }}.tar.gz site
- name: Find Privacy Plugin Cache
uses: actions/cache/restore@v4.0.2
if: steps.privacy_cache_restore.outputs.cache-hit != 'true'
id: privacy_cache_test
with: with:
key: card-cache-${{ inputs.repo }}-${{ inputs.lang }}-${{ inputs.ref }}-${{ hashfiles('config/.cache/plugin/social/manifest.json') }} key: privacy-cache-privacyguides/privacyguides.org-${{ hashfiles('.cache/plugin/privacy/**') }}
lookup-only: true
path: | path: |
config/.cache/plugin/social/manifest.json .cache/plugin/privacy
config/.cache/plugin/social/assets
- uses: actions/upload-artifact@v4 - name: Find Social Plugin Cache
uses: actions/cache/restore@v4.0.2
if: steps.social_cache_restore.outputs.cache-hit != 'true'
id: social_cache_test
with:
key: social-cache-privacyguides/privacyguides.org-${{ inputs.lang }}-${{ hashfiles('.cache/plugin/social/manifest.json') }}
lookup-only: true
path: |
.cache/plugin/social/manifest.json
.cache/plugin/social/assets
- name: Find Optimize Plugin Cache
uses: actions/cache/restore@v4.0.2
if: steps.optimize_cache_restore.outputs.cache-hit != 'true'
id: optimize_cache_test
with:
key: optimize-cache-privacyguides/privacyguides.org-${{ hashfiles('.cache/plugin/optimize/manifest.json') }}
lookup-only: true
path: |
.cache/plugin/optimize
- name: Save Privacy Plugin Cache
uses: actions/cache/save@v4.0.2
if: steps.privacy_cache_test.outputs.cache-hit != 'true'
with:
key: privacy-cache-${{ inputs.repo }}-${{ hashfiles('.cache/plugin/privacy/**') }}
path: .cache/plugin/privacy
- name: Save Social Plugin Cache
uses: actions/cache/save@v4.0.2
if: steps.social_cache_test.outputs.cache-hit != 'true'
with:
key: social-cache-${{ inputs.repo }}-${{ inputs.lang }}-${{ hashfiles('.cache/plugin/social/manifest.json') }}
path: |
.cache/plugin/social/manifest.json
.cache/plugin/social/assets
- name: Save Optimize Plugin Cache
uses: actions/cache/save@v4.0.2
if: steps.optimize_cache_test.outputs.cache-hit != 'true'
with:
key: optimize-cache-${{ inputs.repo }}-${{ hashfiles('.cache/plugin/optimize/manifest.json') }}
path: .cache/plugin/optimize
- name: Upload Site
uses: actions/upload-artifact@v4
with: with:
name: site-${{ inputs.config }}-${{ inputs.lang }}.tar.gz name: site-${{ inputs.config }}-${{ inputs.lang }}.tar.gz
path: site-${{ inputs.config }}-${{ inputs.lang }}.tar.gz path: site-${{ inputs.config }}-${{ inputs.lang }}.tar.gz
retention-days: 1
offline_package: offline_package:
if: inputs.config == 'offline' && inputs.lang == 'en' if: inputs.config == 'offline' && inputs.lang == 'en'
@ -146,8 +287,8 @@ jobs:
name: site-offline-en.tar.gz name: site-offline-en.tar.gz
- run: | - run: |
tar -xzvf site-offline-en.tar.gz tar -xzf site-offline-en.tar.gz
tar -czvf offline.tar.gz site/en tar -czf offline.tar.gz site/en
zip -r -q offline.zip site/en zip -r -q offline.zip site/en
- name: Upload tar.gz file - name: Upload tar.gz file

View File

@ -1,79 +1,100 @@
# Copyright (c) 2024 Jonah Aragon <jonah@triplebit.net>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
name: 📦 PR Preview name: 📦 PR Preview
on: on:
pull_request_target: workflow_run:
workflows: [🛠️ Build PR Preview]
concurrency: types:
group: ${{github.event.pull_request.head.ref}} - completed
cancel-in-progress: true
permissions: permissions:
pull-requests: write actions: read
contents: read contents: read
pull-requests: write
jobs: jobs:
submodule: metadata:
strategy: if: >
matrix: github.event.workflow_run.event == 'pull_request' &&
repo: github.event.workflow_run.conclusion == 'success'
- name: mkdocs-material-insiders
ref: main
- name: brand
ref: main
- name: i18n
ref: main
uses: privacyguides/.github/.github/workflows/download-repo.yml@main
with:
repo: ${{ matrix.repo.name }}
secrets:
ACTIONS_SSH_KEY: ${{ secrets.ACTIONS_SSH_KEY }}
build: runs-on: ubuntu-latest
needs: submodule
strategy: outputs:
matrix: pr_number: ${{ steps.metadata.outputs.pr_number }}
lang: [es, fr, he, it, nl, ru, zh-Hant] sha: ${{ steps.metadata.outputs.sha }}
allow-error: [true]
include: steps:
- lang: en - name: Download Website Build Artifact
allow-error: false uses: actions/github-script@v7.0.1
fail-fast: false with:
permissions: script: |
contents: read var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
uses: ./.github/workflows/build.yml owner: context.repo.owner,
with: repo: context.repo.repo,
ref: ${{github.event.pull_request.head.ref}} run_id: ${{github.event.workflow_run.id }},
repo: ${{github.event.pull_request.head.repo.full_name}} });
lang: ${{ matrix.lang }} var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
continue-on-error: ${{ matrix.allow-error }} return artifact.name == "site-build-combined"
})[0];
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/site-build-combined.zip', Buffer.from(download.data));
- name: Unpack Website
run: |
mkdir -p site
unzip site-build-combined.zip -d site
tar -czvf site-build-combined.tar.gz site
- name: Upload Combined Build Artifact
uses: actions/upload-artifact@v4
with:
name: site-build-combined.tar.gz
path: site-build-combined.tar.gz
retention-days: 5
- name: Download Metadata Artifact
uses: actions/github-script@v7.0.1
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "metadata"
})[0];
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/metadata.zip', Buffer.from(download.data));
- name: Set Metadata
id: metadata
run: |
mkdir -p metadata
unzip metadata.zip -d metadata
echo "pr_number=$(cat metadata/NR)" >> "$GITHUB_OUTPUT"
echo "sha=$(cat metadata/SHA)" >> "$GITHUB_OUTPUT"
deploy: deploy:
needs: build needs: metadata
permissions: permissions:
contents: read contents: read
uses: privacyguides/webserver/.github/workflows/deploy-netlify-preview.yml@main uses: privacyguides/webserver/.github/workflows/deploy-netlify-preview.yml@main
with: with:
netlify_alias: ${{ github.event.pull_request.head.sha }} netlify_alias: ${{ needs.metadata.outputs.pr_number }}
netlify_site_id: ${{ vars.NETLIFY_SITE }} netlify_site_id: ${{ vars.NETLIFY_SITE }}
secrets: secrets:
NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }} NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
@ -81,23 +102,19 @@ jobs:
comment: comment:
permissions: permissions:
pull-requests: write pull-requests: write
needs: deploy needs: [deploy, metadata]
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
address: ${{ needs.deploy.outputs.address }} address: ${{ needs.deploy.outputs.address }}
steps: steps:
- uses: thollander/actions-comment-pull-request@v2.5.0 - uses: thollander/actions-comment-pull-request@v2.5.0
with: with:
pr_number: ${{ needs.metadata.outputs.pr_number }}
message: | message: |
### <span aria-hidden="true">✅</span> Your preview is ready! ### <span aria-hidden="true">✅</span> Your preview is ready!
| Name | Link | | Name | Link |
| :---: | ---- | | :---: | ---- |
| <span aria-hidden="true">🔨</span> Latest commit | ${{ github.event.pull_request.head.sha }} | | <span aria-hidden="true">🔨</span> Latest commit | ${{ needs.metadata.outputs.sha }} |
| <span aria-hidden="true">😎</span> Preview | ${{ env.address }} | | <span aria-hidden="true">😎</span> Preview | ${{ env.address }} |
comment_tag: deployment comment_tag: deployment
cleanup:
if: ${{ always() }}
needs: build
uses: privacyguides/.github/.github/workflows/cleanup.yml@main

View File

@ -41,7 +41,7 @@ jobs:
needs: submodule needs: submodule
strategy: strategy:
matrix: matrix:
lang: [en, es, fr, he, it, nl, ru, zh-Hant] lang: [en, fr, he]
build: [build, offline] build: [build, offline]
fail-fast: false fail-fast: false
permissions: permissions:

13
.gitignore vendored
View File

@ -9,13 +9,11 @@ site
# see: https://github.com/squidfunk/mkdocs-material/issues/6983 # see: https://github.com/squidfunk/mkdocs-material/issues/6983
# ridiculous hide-and-seek https://stackoverflow.com/a/72380673 # ridiculous hide-and-seek https://stackoverflow.com/a/72380673
.cache/* .cache/*
!/config/.cache !.cache/plugin
/config/.cache/* /.cache/plugin/*
!/config/.cache/plugin !.cache/plugin/social
/config/.cache/plugin/* /.cache/plugin/social/*
!/config/.cache/plugin/social !.cache/plugin/social/fonts
/config/.cache/plugin/social/*
!/config/.cache/plugin/social/fonts
# Local Netlify folder # Local Netlify folder
.netlify .netlify
@ -23,3 +21,4 @@ node_modules
# Python # Python
.venv .venv
.env

View File

@ -57,9 +57,8 @@ WORKDIR /site
COPY docs docs COPY docs docs
COPY theme theme COPY theme theme
COPY includes includes COPY includes includes
COPY config/*.yml config/ COPY *.yml .
COPY config/layouts config/layouts COPY .cache/plugin/social/fonts .cache/plugin/social/fonts
COPY config/.cache/plugin/social/fonts config/.cache/plugin/social/fonts
EXPOSE 8000 EXPOSE 8000
@ -68,4 +67,4 @@ ENV MKDOCS_INHERIT mkdocs-production.yml
HEALTHCHECK NONE HEALTHCHECK NONE
ENTRYPOINT ["mkdocs"] ENTRYPOINT ["mkdocs"]
CMD ["serve", "--dev-addr=0.0.0.0:8000", "--config-file=config/mkdocs.en.yml"] CMD ["serve", "--dev-addr=0.0.0.0:8000", "--config-file=mkdocs-production.yml"]

View File

@ -113,11 +113,11 @@ Committing to this repository requires [signing your commits](https://docs.githu
### With `mkdocs-material` ### With `mkdocs-material`
1. Install required packages: `pip install mkdocs-material` 1. Install required packages: `pip install mkdocs-material`
2. Run a local preview of the English site: `mkdocs serve --config-file config/mkdocs.en.yml` 2. Run a local preview of the English site: `mkdocs serve`
### With `mkdocs-material-insiders` ### With `mkdocs-material-insiders`
This website uses [`mkdocs-material-insiders`](https://squidfunk.github.io/mkdocs-material/insiders) which offers additional functionality over the open-source `mkdocs-material` project. For obvious reasons we cannot distribute access to the insiders repository. If you are submitting a PR, please ensure the automatic preview generated for your PR looks correct, as that site will be built with the production insiders build. This website uses [`mkdocs-material-insiders`](https://squidfunk.github.io/mkdocs-material/insiders) which offers additional functionality over the open-source `mkdocs-material` project. For obvious reasons we cannot distribute access to the insiders repository.
**Team members** should clone the repository with `mkdocs-material-insiders` directly. This method is identical to production: **Team members** should clone the repository with `mkdocs-material-insiders` directly. This method is identical to production:
@ -126,23 +126,13 @@ This website uses [`mkdocs-material-insiders`](https://squidfunk.github.io/mkdoc
3. Install Python **3.12**. 3. Install Python **3.12**.
4. Install **pipenv**: `pip install pipenv` 4. Install **pipenv**: `pip install pipenv`
5. Install dependencies: `pipenv install --dev` (install [Pillow and CairoSVG](https://squidfunk.github.io/mkdocs-material/setup/setting-up-social-cards/#dependencies) as well to generate social cards) 5. Install dependencies: `pipenv install --dev` (install [Pillow and CairoSVG](https://squidfunk.github.io/mkdocs-material/setup/setting-up-social-cards/#dependencies) as well to generate social cards)
6. Serve the site locally: `MKDOCS_INHERIT=mkdocs-production.yml pipenv run mkdocs serve --config-file config/mkdocs.en.yml` (set `CARDS=true` to generate social cards) 6. Serve the site locally: `pipenv run mkdocs serve --config-file mkdocs-production.yml` (set `CARDS=true` to generate social cards)
- The site will be available at `http://localhost:8000` - The site will be available at `http://localhost:8000`
- You can build the site locally with `MKDOCS_INHERIT=mkdocs-production.yml pipenv run mkdocs build --config-file config/mkdocs.en.yml` - You can build the site locally with `pipenv run mkdocs build --config-file mkdocs-production.yml`
- This version of the site should be identical to the live, production version - This version of the site should be identical to the live, production version
If you commit to `main` with commits signed with your SSH key, you should add your SSH key to [`.allowed_signers`](/.allowed_signers) in this repo. If you commit to `main` with commits signed with your SSH key, you should add your SSH key to [`.allowed_signers`](/.allowed_signers) in this repo.
### Local Translated Site Builds
1. Install the [Crowdin CLI Tool](https://developer.crowdin.com/cli-tool) (`brew install crowdin`)
2. Set the `CROWDIN_PERSONAL_TOKEN` environment variable to your Crowdin personal access token
3. Run `crowdin download` in the root of this repo
4. Import the language's environment variables: `set -a; source includes/strings.fr.env; set +a` (replacing fr with the appropriate language)
5. Serve the site locally: `pipenv run mkdocs serve --config-file config/mkdocs.fr.yml` (replacing fr with the appropriate language in [/config](/config))
Translations downloaded from Crowdin are [.gitignore](/.gitignore)'d, so any local changes to the translated site cannot be committed to this repo. Actual modifications need to be made on Crowdin. As an alternative to steps 1-3, you can copy the folders from [privacyguides/i18n](https://github.com/privacyguides/i18n) to the root of this repo to obtain the translated files.
## Releasing ## Releasing
It is required to create a GitHub release to publish the current site to privacyguides.org. The current `main` branch can be previewed at [https://main.staging.privacyguides.dev](https://main.staging.privacyguides.dev) prior to release. It is required to create a GitHub release to publish the current site to privacyguides.org. The current `main` branch can be previewed at [https://main.staging.privacyguides.dev](https://main.staging.privacyguides.dev) prior to release.

View File

@ -1 +0,0 @@
../../../../theme/assets/brand/fonts

View File

@ -1,70 +0,0 @@
# Copyright (c) 2023-2024 Jonah Aragon <jonah@triplebit.net>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
INHERIT: mkdocs-common.yml
# Disable any GitHub integrations
repo_url: ""
edit_uri_template: ""
extra:
# Disable language switcher
alternate: false
offline: true
privacy_guides:
homepage:
hero:
buttons:
- name:
!ENV [
HOMEPAGE_BUTTON_GET_STARTED_NAME,
"Start Your Privacy Journey",
]
title:
!ENV [
HOMEPAGE_BUTTON_GET_STARTED_TITLE,
"The first step of your privacy journey",
]
link: basics/why-privacy-matters.html
class: md-button md-button--primary
- name: !ENV [HOMEPAGE_BUTTON_TOOLS_NAME, "Recommended Tools"]
title:
!ENV [
HOMEPAGE_BUTTON_TOOLS_TITLE,
"Recommended privacy tools, services, and knowledge",
]
link: tools.html
class: md-button
theme:
features:
- navigation.tabs
- navigation.sections
- navigation.indexes
- content.tabs.link
- content.tooltips
- search.highlight
plugins:
offline:
enabled: true
social:
enabled: false
# Edit the offline-mode navbar in mkdocs-common.yml

View File

@ -1,29 +0,0 @@
INHERIT: mkdocs-common.yml
plugins:
macros: {}
meta: {}
git-committers:
enabled: !ENV [GITCOMMITTERS, PRODUCTION, NETLIFY, false]
repository: privacyguides/privacyguides.org
branch: main
git-revision-date-localized:
enabled: !ENV [GITREVISIONDATE, PRODUCTION, NETLIFY, false]
exclude:
- index.md
fallback_to_build_date: true
optimize:
enabled: !ENV [OPTIMIZE, PRODUCTION, NETLIFY, false]
typeset: {}
social:
cards: !ENV [CARDS, PRODUCTION, NETLIFY, true]
cards_dir: assets/img/social
cards_layout_dir: config/layouts
cards_layout: page
# cards_layout: pride
markdown_extensions:
material.extensions.preview:
sources:
exclude:
- tools.md

View File

@ -1,34 +0,0 @@
# Copyright (c) 2022-2024 Jonah Aragon <jonah@triplebit.net>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
INHERIT: !ENV [MKDOCS_INHERIT, mkdocs-common.yml]
docs_dir: "../i18n/es"
site_url: "https://www.privacyguides.org/es/"
site_dir: "../site/es"
edit_uri_template: https://github.com/privacyguides/i18n/blob/main/i18n/es/{path}?plain=1
theme:
language: es
markdown_extensions:
pymdownx.snippets:
auto_append:
- includes/abbreviations.es.txt

View File

@ -1,34 +0,0 @@
# Copyright (c) 2022-2024 Jonah Aragon <jonah@triplebit.net>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
INHERIT: !ENV [MKDOCS_INHERIT, mkdocs-common.yml]
docs_dir: "../i18n/fr"
site_url: "https://www.privacyguides.org/fr/"
site_dir: "../site/fr"
edit_uri_template: https://github.com/privacyguides/i18n/blob/main/i18n/fr/{path}?plain=1
theme:
language: fr
markdown_extensions:
pymdownx.snippets:
auto_append:
- includes/abbreviations.fr.txt

View File

@ -1,41 +0,0 @@
# Copyright (c) 2022-2024 Jonah Aragon <jonah@triplebit.net>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
INHERIT: !ENV [MKDOCS_INHERIT, mkdocs-common.yml]
docs_dir: "../i18n/he"
site_url: "https://www.privacyguides.org/he/"
site_dir: "../site/he"
edit_uri_template: https://github.com/privacyguides/i18n/blob/main/i18n/he/{path}?plain=1
extra_css:
- assets/stylesheets/extra.css?v=3.2.0
- assets/stylesheets/lang-he.css?v=3.4.0
theme:
language: he
font:
text: Open Sans
code: Cousine
markdown_extensions:
pymdownx.snippets:
auto_append:
- includes/abbreviations.he.txt

View File

@ -1,34 +0,0 @@
# Copyright (c) 2022-2024 Jonah Aragon <jonah@triplebit.net>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
INHERIT: !ENV [MKDOCS_INHERIT, mkdocs-common.yml]
docs_dir: "../i18n/it"
site_url: "https://www.privacyguides.org/it/"
site_dir: "../site/it"
edit_uri_template: https://github.com/privacyguides/i18n/blob/main/i18n/it/{path}?plain=1
theme:
language: it
markdown_extensions:
pymdownx.snippets:
auto_append:
- includes/abbreviations.it.txt

View File

@ -1,34 +0,0 @@
# Copyright (c) 2022-2024 Jonah Aragon <jonah@triplebit.net>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
INHERIT: !ENV [MKDOCS_INHERIT, mkdocs-common.yml]
docs_dir: "../i18n/nl"
site_url: "https://www.privacyguides.org/nl/"
site_dir: "../site/nl"
edit_uri_template: https://github.com/privacyguides/i18n/blob/main/i18n/nl/{path}?plain=1
theme:
language: nl
markdown_extensions:
pymdownx.snippets:
auto_append:
- includes/abbreviations.nl.txt

View File

@ -1,38 +0,0 @@
# Copyright (c) 2022-2024 Jonah Aragon <jonah@triplebit.net>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
INHERIT: !ENV [MKDOCS_INHERIT, mkdocs-common.yml]
docs_dir: "../i18n/ru"
site_url: "https://www.privacyguides.org/ru/"
site_dir: "../site/ru"
edit_uri_template: https://github.com/privacyguides/i18n/blob/main/i18n/ru/{path}?plain=1
extra_css:
- assets/stylesheets/extra.css?v=3.2.0
- assets/stylesheets/lang-ru.css?v=3.13.0
theme:
language: ru
markdown_extensions:
pymdownx.snippets:
auto_append:
- includes/abbreviations.ru.txt

View File

@ -1,41 +0,0 @@
# Copyright (c) 2022-2024 Jonah Aragon <jonah@triplebit.net>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
INHERIT: !ENV [MKDOCS_INHERIT, mkdocs-common.yml]
docs_dir: "../i18n/zh-Hant"
site_url: "https://www.privacyguides.org/zh-Hant/"
site_dir: "../site/zh-Hant"
edit_uri_template: https://github.com/privacyguides/i18n/blob/main/i18n/zh-Hant/{path}?plain=1
extra_css:
- assets/stylesheets/extra.css?v=3.2.0
- assets/stylesheets/lang-zh-Hant.css?v=3.13.0
theme:
language: zh-Hant
font:
text: Noto Sans TC
code: Noto Sans TC
markdown_extensions:
pymdownx.snippets:
auto_append:
- includes/abbreviations.zh-Hant.txt

View File

@ -18,10 +18,10 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE. # IN THE SOFTWARE.
INHERIT: !ENV [MKDOCS_INHERIT, mkdocs-common.yml] INHERIT: mkdocs.yml
site_url: "https://www.privacyguides.org/en/"
site_dir: "../site/en"
theme: markdown_extensions:
# ENGLISH ONLY: this logo needs to be set separately because the relative path is different material.extensions.preview:
logo: ../theme/assets/brand/logos/svg/logo/privacy-guides-logo-notext-colorbg.svg sources:
exclude:
- tools.md

View File

@ -18,9 +18,9 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE. # IN THE SOFTWARE.
docs_dir: "../docs" docs_dir: !ENV [BUILD_DOCS_DIR, "docs"]
site_url: "https://www.privacyguides.org/" site_url: !ENV [BUILD_SITE_URL, "https://www.privacyguides.org/en/"]
site_dir: "../site" site_dir: !ENV [BUILD_SITE_DIR, "site/en"]
site_name: Privacy Guides site_name: Privacy Guides
site_description: site_description:
@ -28,11 +28,13 @@ site_description:
SITE_DESCRIPTION, SITE_DESCRIPTION,
"Privacy Guides is your central privacy and security resource to protect yourself online.", "Privacy Guides is your central privacy and security resource to protect yourself online.",
] ]
edit_uri_template: blob/main/docs/{path}?plain=1 edit_uri_template:
!ENV [BUILD_EDIT_URI_TEMPLATE, "blob/main/docs/{path}?plain=1"]
extra: extra:
generator: false generator: false
context: !ENV [CONTEXT, "production"] context: !ENV [BUILD_CONTEXT, "production"]
offline: !ENV [BUILD_OFFLINE, false]
deploy: !ENV DEPLOY_ID deploy: !ENV DEPLOY_ID
privacy_guides: privacy_guides:
footer: footer:
@ -80,7 +82,11 @@ extra:
HOMEPAGE_BUTTON_GET_STARTED_TITLE, HOMEPAGE_BUTTON_GET_STARTED_TITLE,
"The first step of your privacy journey", "The first step of your privacy journey",
] ]
link: basics/why-privacy-matters/ link:
!ENV [
HOMEPAGE_BUTTON_GET_STARTED_LINK,
"basics/why-privacy-matters/",
]
class: md-button md-button--primary class: md-button md-button--primary
- name: !ENV [HOMEPAGE_BUTTON_TOOLS_NAME, "Recommended Tools"] - name: !ENV [HOMEPAGE_BUTTON_TOOLS_NAME, "Recommended Tools"]
title: title:
@ -88,7 +94,7 @@ extra:
HOMEPAGE_BUTTON_TOOLS_TITLE, HOMEPAGE_BUTTON_TOOLS_TITLE,
"Recommended privacy tools, services, and knowledge", "Recommended privacy tools, services, and knowledge",
] ]
link: tools/ link: !ENV [HOMEPAGE_BUTTON_TOOLS_LINK, "tools/"]
class: md-button class: md-button
cta: cta:
- title: - title:
@ -161,6 +167,7 @@ extra:
notice: !ENV TRANSLATION_NOTICE notice: !ENV TRANSLATION_NOTICE
cta: !ENV [TRANSLATION_NOTICE_CTA, "Visit Crowdin"] cta: !ENV [TRANSLATION_NOTICE_CTA, "Visit Crowdin"]
language: !ENV SITE_LANGUAGE_ENGLISH language: !ENV SITE_LANGUAGE_ENGLISH
translation_stylesheet: !ENV [TRANSLATION_STYLESHEET]
social: social:
- icon: simple/mastodon - icon: simple/mastodon
link: https://mastodon.neat.computer/@privacyguides link: https://mastodon.neat.computer/@privacyguides
@ -247,17 +254,17 @@ extra:
- accept - accept
- manage - manage
repo_url: https://github.com/privacyguides/privacyguides.org repo_url:
!ENV [BUILD_REPO_URL, "https://github.com/privacyguides/privacyguides.org"]
repo_name: "" repo_name: ""
theme: theme:
name: material name: material
language: en language: !ENV [BUILD_THEME_LANGUAGE, "en"]
custom_dir: ../theme custom_dir: theme
logo: ../../theme/assets/brand/logos/svg/logo/privacy-guides-logo-notext-colorbg.svg
font: font:
text: Public Sans text: !ENV [BUILD_THEME_FONT_TEXT, "Public Sans"]
code: DM Mono code: !ENV [BUILD_THEME_FONT_CODE, "DM Mono"]
palette: palette:
- media: "(prefers-color-scheme)" - media: "(prefers-color-scheme)"
scheme: default scheme: default
@ -300,14 +307,36 @@ extra_javascript:
- assets/javascripts/feedback.js?v=1 - assets/javascripts/feedback.js?v=1
watch: watch:
- ../theme - theme
- ../includes - includes
- mkdocs-common.yml
plugins: plugins:
tags: {} tags: {}
search: {} search: {}
privacy: {} privacy: {}
group:
enabled: !ENV [BUILD_INSIDERS, false]
plugins:
macros: {}
meta: {}
git-committers:
enabled: !ENV [GITCOMMITTERS, PRODUCTION, NETLIFY, false]
repository: privacyguides/privacyguides.org
branch: main
git-revision-date-localized:
enabled: !ENV [GITREVISIONDATE, PRODUCTION, NETLIFY, false]
exclude:
- index.md
fallback_to_build_date: true
optimize:
enabled: !ENV [OPTIMIZE, PRODUCTION, NETLIFY, false]
typeset: {}
social:
cards: !ENV [CARDS, true]
cards_dir: assets/img/social
cards_layout_dir: theme/layouts
cards_layout: page
# cards_layout: pride
markdown_extensions: markdown_extensions:
admonition: {} admonition: {}
@ -328,7 +357,7 @@ markdown_extensions:
pymdownx.tilde: {} pymdownx.tilde: {}
pymdownx.snippets: pymdownx.snippets:
auto_append: auto_append:
- includes/abbreviations.en.txt - !ENV [BUILD_ABBREVIATIONS, "includes/abbreviations.en.txt"]
pymdownx.tasklist: pymdownx.tasklist:
custom_checkbox: true custom_checkbox: true
attr_list: {} attr_list: {}

View File

@ -30,7 +30,7 @@ definitions:
{{ page.meta.get("description", config.site_description) or "" }} {{ page.meta.get("description", config.site_description) or "" }}
- &logo >- - &logo >-
{{ config.docs_dir }}/{{ config.theme.logo }} theme/assets/brand/logos/svg/logo/privacy-guides-logo-notext-colorbg.svg
# Meta tags # Meta tags
tags: tags:

View File

@ -63,8 +63,8 @@ definitions:
- &logo >- - &logo >-
{%- if page.meta.cover -%} {%- if page.meta.cover -%}
theme/assets/brand/logos/svg/logo/privacy-guides-logo-notext.svg theme/assets/brand/logos/svg/logo/privacy-guides-logo-notext.svg
{%- elif config.theme.logo -%} {%- else -%}
{{ config.docs_dir }}/{{ config.theme.logo }} theme/assets/brand/logos/svg/logo/privacy-guides-logo-notext-colorbg.svg
{%- endif -%} {%- endif -%}
# Meta tags # Meta tags

View File

@ -71,6 +71,12 @@
{% endblock %} {% endblock %}
{% block extrahead %} {% block extrahead %}
<!-- language-specific stylesheets -->
{% if config.extra.privacy_guides.translation_stylesheet %}
<link rel="stylesheet" href="{{ config.extra.privacy_guides.translation_stylesheet | url }}" />
{% endif %}
<meta name="robots" content="max-snippet:-1, max-image-preview:large"> <meta name="robots" content="max-snippet:-1, max-image-preview:large">
{% if config.extra.context == "production" %} {% if config.extra.context == "production" %}
<meta http-equiv="onion-location" content="{{ "http://www.xoe4vn5uwdztif6goazfbmogh6wh5jc4up35bqdflu6bkdc5cas5vjqd.onion/" ~ config.theme.language ~ "/" ~ page.url }}" /> <meta http-equiv="onion-location" content="{{ "http://www.xoe4vn5uwdztif6goazfbmogh6wh5jc4up35bqdflu6bkdc5cas5vjqd.onion/" ~ config.theme.language ~ "/" ~ page.url }}" />