diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 98c68153..ab2478f7 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -51,7 +51,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - pipenv run mkdocs build + pipenv run mkdocs build --config-file mkdocs.production.yml mv .well-known site/ pipenv run mkdocs --version diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 7c1bc2b1..aca369a5 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -43,4 +43,4 @@ jobs: build: | pip install pipenv pipenv install - pipenv run mkdocs build + pipenv run mkdocs build --config-file mkdocs.production.yml diff --git a/README.md b/README.md index 2ad23a03..1118fa7c 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ This website uses [`mkdocs-material-insiders`](https://squidfunk.github.io/mkdoc - `git submodule init` - `git submodule update docs/assets/brand` 2. Install [Python 3.6+](https://www.python.org/downloads/) -3. Install [dependencies](/Pipfile): `pip install mkdocs mkdocs-material mkdocs-static-i18n mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-rss-plugin typing-extensions` +3. Install [dependencies](/Pipfile): `pip install mkdocs mkdocs-material mkdocs-static-i18n typing-extensions` 4. Serve the site locally: `mkdocs serve` - The site will be available at `http://localhost:8000` - You can build the site locally with `mkdocs build` @@ -91,10 +91,10 @@ This website uses [`mkdocs-material-insiders`](https://squidfunk.github.io/mkdoc **Team members** should clone the repository with `mkdocs-material-insiders` directly. This method is identical to production: 1. Clone this repository and submodules: `git clone --recurse-submodules https://github.com/privacyguides/privacyguides.org.git` -2. Install [Python 3.6+](https://www.python.org/downloads/) +2. Install Python **3.7** 3. Install **pipenv**: `pip install pipenv` 4. Install dependencies: `pipenv install --dev` -5. Serve the site locally: `pipenv run mkdocs serve` +5. Serve the site locally: `pipenv run mkdocs serve --config-file mkdocs.production.yml` - The site will be available at `http://localhost:8000` - You can build the site locally with `pipenv run mkdocs build` - This version of the site should be identical to the live, production version diff --git a/mkdocs.production.yml b/mkdocs.production.yml new file mode 100644 index 00000000..5fbcc47b --- /dev/null +++ b/mkdocs.production.yml @@ -0,0 +1,70 @@ +INHERIT: mkdocs.yml +plugins: + minify: + minify_html: true + htmlmin_opts: + remove_comments: true + privacy: + externals_exclude: + - cdn.jsdelivr.net/npm/mathjax@3/* + - api.privacyguides.net/* + - giscus.app/* + git-committers: + repository: privacyguides/privacyguides.org + branch: main + token: !ENV GH_TOKEN + git-revision-date-localized: + exclude: + - index.en.md + rss: + match_path: "blog/.*" + pretty_print: true + date_from_meta: + as_creation: "created" + datetime_format: "%Y-%m-%d" + +extra: + generator: false + analytics: + provider: plausible + property: privacyguides.org + feedback: + title: Was this page helpful? + ratings: + - icon: hero/emoji-happy + name: This page was helpful + data: Helpful + note: Thanks for your feedback! + - icon: hero/emoji-sad + name: This page could be improved + data: Needs Improvement + note: Thanks for your feedback! Help us improve this page by opening a discusson on GitHub. + +theme: + features: + - navigation.tracking + - navigation.tabs + - navigation.sections + - content.tooltips + palette: + - media: "(prefers-color-scheme)" + toggle: + icon: hero/sparkles + name: Switch to light mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + accent: amber + toggle: + icon: hero/moon + name: Switch to system theme + - media: "(prefers-color-scheme: light)" + scheme: default + accent: deep purple + toggle: + icon: hero/sun + name: Switch to dark mode + +watch: + - theme + - includes + - mkdocs.yml diff --git a/mkdocs.yml b/mkdocs.yml index 77f5a7c3..7512192b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,21 +11,6 @@ copyright: | This content was made available by the Privacy Guides team and contributors. Get involved! extra: - generator: false - analytics: - provider: plausible - property: privacyguides.org - feedback: - title: Was this page helpful? - ratings: - - icon: hero/emoji-happy - name: This page was helpful - data: Helpful - note: Thanks for your feedback! - - icon: hero/emoji-sad - name: This page could be improved - data: Needs Improvement - note: Thanks for your feedback! Help us improve this page by opening a discusson on GitHub. social: - icon: pg/matrix link: https://matrix.to/#/#privacyguides:matrix.org @@ -57,97 +42,74 @@ theme: - navigation.tracking - navigation.tabs - navigation.sections - - content.tooltips palette: - - media: "(prefers-color-scheme: light)" - scheme: default + - scheme: default accent: deep purple toggle: icon: hero/sun name: Switch to dark mode - - media: "(prefers-color-scheme: dark)" - scheme: slate + - scheme: slate accent: amber toggle: icon: hero/moon name: Switch to light mode + watch: - theme - includes plugins: - - minify: - minify_html: true - htmlmin_opts: - remove_comments: true - - i18n: - default_language: en - material_alternate: true - languages: - en: - name: English - build: false - - tags - - search - - git-revision-date-localized: - exclude: - - index.en.md - - rss: - match_path: "blog/.*" - pretty_print: true - date_from_meta: - as_creation: "created" - datetime_format: "%Y-%m-%d" - - privacy: - externals_exclude: - - cdn.jsdelivr.net/npm/mathjax@3/* - - api.privacyguides.net/* - - giscus.app/* - - git-committers: - repository: privacyguides/privacyguides.org - branch: main - token: !ENV GH_TOKEN + i18n: + default_language: en + material_alternate: true + languages: + en: + name: English + build: false + tags: {} + search: {} + +markdown_extensions: + admonition: {} + pymdownx.details: {} + pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format + pymdownx.tabbed: + alternate_style: true + pymdownx.arithmatex: + generic: true + pymdownx.critic: {} + pymdownx.caret: {} + pymdownx.keys: {} + pymdownx.mark: {} + pymdownx.tilde: {} + pymdownx.snippets: + auto_append: + - includes/abbreviations.en.md + pymdownx.tasklist: + custom_checkbox: true + attr_list: {} + def_list: {} + md_in_html: {} + meta: {} + abbr: {} + pymdownx.emoji: + emoji_index: !!python/name:materialx.emoji.twemoji + emoji_generator: !!python/name:materialx.emoji.to_svg + options: + custom_icons: + - theme/.icons + tables: {} + footnotes: {} + toc: + permalink: true + toc_depth: 4 + extra_css: - assets/stylesheets/extra.css?v=2.10.0 -markdown_extensions: - - admonition - - pymdownx.details - - pymdownx.superfences: - custom_fences: - - name: mermaid - class: mermaid - format: !!python/name:pymdownx.superfences.fence_code_format - - pymdownx.tabbed: - alternate_style: true - - pymdownx.arithmatex: - generic: true - - pymdownx.critic - - pymdownx.caret - - pymdownx.keys - - pymdownx.mark - - pymdownx.tilde - - pymdownx.snippets: - auto_append: - - includes/abbreviations.en.md - - pymdownx.tasklist: - custom_checkbox: true - - attr_list - - def_list - - md_in_html - - meta - - abbr - - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg - options: - custom_icons: - - theme/.icons - - tables - - footnotes - - toc: - permalink: true - toc_depth: 4 - extra_javascript: - assets/javascripts/mathjax.js - assets/javascripts/feedback.js