diff --git a/config/layouts/custom.yml b/config/layouts/custom.yml index 9ca064e3..60eaa80c 100644 --- a/config/layouts/custom.yml +++ b/config/layouts/custom.yml @@ -21,8 +21,12 @@ definitions: {{ layout.color or "#2d2d2d" }} - &title_font_family >- - {%- if config.theme.language == "he" -%} + {%- if page.is_homepage -%} + Bagnard + {%- elif config.theme.language == "he" -%} Suez One + {%- elif config.theme.language == "zh-Hant" -%} + Noto Serif TC {%- else -%} Bagnard {%- endif -%} @@ -30,6 +34,8 @@ definitions: - &font_family >- {%- if config.theme.language == "he" -%} Suez One + {%- elif config.theme.language == "zh-Hant" -%} + Noto Sans TC {%- else -%} Public Sans {%- endif -%} @@ -64,7 +70,7 @@ definitions: - &homepage_description >- {%- if page.is_homepage -%} - A socially motivated website which provides information about protecting your online data privacy and security. + {{ config.extra.homepage_description or "A socially motivated website which provides information about protecting your online data privacy and security." }} {%- else -%} {%- endif -%} diff --git a/config/mkdocs-common.yml b/config/mkdocs-common.yml index 7b0b134b..8f9573fe 100644 --- a/config/mkdocs-common.yml +++ b/config/mkdocs-common.yml @@ -62,6 +62,10 @@ extra: link: /nl/ lang: nl icon: https://raw.githubusercontent.com/twitter/twemoji/master/assets/svg/1f1f3-1f1f1.svg + - name: 正體中文 + link: /zh-hant/ + lang: zh-Hant + icon: https://raw.githubusercontent.com/twitter/twemoji/master/assets/svg/1f1ed-1f1f0.svg repo_url: https://github.com/privacyguides/privacyguides.org repo_name: "" diff --git a/config/mkdocs.zh-Hant.yml b/config/mkdocs.zh-Hant.yml new file mode 100644 index 00000000..25b86df7 --- /dev/null +++ b/config/mkdocs.zh-Hant.yml @@ -0,0 +1,164 @@ +# Copyright (c) 2022-2023 Jonah Aragon + +# 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 +docs_dir: '../i18n/zh-Hant' +site_url: "https://www.privacyguides.org/zh-hant/" +site_dir: '../site/zh-hant' + +site_name: Privacy Guides +site_description: | + Privacy Guides 是您重要的網路隱私與安全資源。 +copyright: | + Privacy Guides 是一個非營利、社會導向的網站,旨在提供有關資訊以確保您的資料安全和隱私。
+ 我們不會通過推薦某些產品來賺錢,我們也不會使用推廣回贈鏈接。 + © 2019 - 2023 Privacy Guides 和貢獻者。 + + 根據CC BY-ND 4.0授權的內容。 CC BY-ND 4.0. +edit_uri: edit/main/i18n/zh-Hant/ + +extra: + generator: false + analytics: + provider: plausible + property: privacyguides.org + feedback: + title: "這個頁面對您有幫助嗎?" + ratings: + - icon: material/robot-happy-outline + name: "此頁有幫助" + data: Helpful + note: "感謝反饋!" + - icon: material/robot-confused + name: "此頁面可以改善" + data: Needs Improvement + note: "感謝你的意見!通過在的論壇上開啟討論來協助我們改善此頁面。" + +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 + palette: + - media: "(prefers-color-scheme)" + scheme: default + accent: deep purple + toggle: + icon: material/brightness-auto + name: "切換至深色模式" + - media: "(prefers-color-scheme: dark)" + scheme: slate + accent: amber + toggle: + icon: material/brightness-2 + name: "切換至淺色模式" + - media: "(prefers-color-scheme: light)" + scheme: default + accent: deep purple + toggle: + icon: material/brightness-5 + name: "切換到系統主題" + +markdown_extensions: + pymdownx.snippets: + auto_append: + - includes/abbreviations.zh-Hant.txt + +nav: + - 首頁: 'index.md' + - 知識庫: + - 'basics/why-privacy-matters.md' + - 'basics/threat-modeling.md' + - 'basics/common-threats.md' + - 'basics/common-misconceptions.md' + - 'basics/account-creation.md' + - 'basics/account-deletion.md' + - 技術精華: + - 'basics/passwords-overview.md' + - 'basics/multi-factor-authentication.md' + - 'basics/email-security.md' + - 'basics/vpn-overview.md' + - 進階主題: + - 'advanced/dns-overview.md' + - 'advanced/tor-overview.md' + - 'advanced/payments.md' + - 'advanced/communication-network-types.md' + - 作業系統: + - 'os/android-overview.md' + - 'os/linux-overview.md' + - 'os/qubes-overview.md' + - kb-archive.md + - 推薦: + - 'tools.md' + - 網際網路瀏覽: + - 'tor.md' + - 'desktop-browsers.md' + - 'mobile-browsers.md' + - 提供者: + - 'cloud.md' + - 'dns.md' + - 'email.md' + - 'financial-services.md' + - 'search-engines.md' + - 'vpn.md' + - 軟體: + - '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' + - 作業系統: + - 'android.md' + - 'desktop.md' + - 'router.md' + - 關於: + - 'about/index.md' + - 'about/criteria.md' + - 'about/statistics.md' + - 'about/notices.md' + - 'about/privacy-policy.md' + - 社群: + - 'about/donate.md' + - 線上服務: 'about/services.md' + - 行為守則: 'CODE_OF_CONDUCT.md' + - 'about/privacytools.md' + - 貢獻: + - 寫作指南: + - 'meta/writing-style.md' + - 'meta/brand.md' + - 技術指導: + - 'meta/uploading-images.md' + - 'meta/git-recommendations.md' + - 變更記錄: 'https://github.com/privacyguides/privacyguides.org/releases' + - 論壇: 'https://discuss.privacyguides.net/' + - 部落格: 'https://blog.privacyguides.org/' diff --git a/includes/strings.en.yml b/includes/strings.en.yml index 23a51dd1..30e0f83b 100644 --- a/includes/strings.en.yml +++ b/includes/strings.en.yml @@ -45,5 +45,7 @@ nav: Blog: Blog site: + homepage_card: | + A socially motivated website which provides information about protecting your online data privacy and security. translation: | You're viewing the English copy of Privacy Guides, translated by our fantastic language team on Crowdin. If you notice an error, or see any untranslated sections on this page, please consider helping out! For more information and tips see our translation guide. diff --git a/netlify.toml b/netlify.toml index 05eb156d..69124f8d 100644 --- a/netlify.toml +++ b/netlify.toml @@ -23,10 +23,10 @@ command = "mkdocs build --config-file config/mkdocs.en.yml && cp -r static/* site/" [context.production] - command = "crowdin download && mkdocs build --config-file config/mkdocs.en.yml && mkdocs build --config-file config/mkdocs.es.yml && mkdocs build --config-file config/mkdocs.fr.yml && mkdocs build --config-file config/mkdocs.he.yml && mkdocs build --config-file config/mkdocs.it.yml && mkdocs build --config-file config/mkdocs.nl.yml && cp -r static/* site/" + command = "git clone https://github.com/privacyguides/i18n i18n-download && cp -rl i18n-download/i18n . && cp -rl i18n-download/includes . && cp -rl i18n-download/theme . && mkdocs build --config-file config/mkdocs.en.yml && mkdocs build --config-file config/mkdocs.es.yml && mkdocs build --config-file config/mkdocs.fr.yml && mkdocs build --config-file config/mkdocs.he.yml && mkdocs build --config-file config/mkdocs.it.yml && mkdocs build --config-file config/mkdocs.nl.yml && mkdocs build --config-file config/mkdocs.zh-Hant.yml && cp -r static/* site/" [context.branch-deploy] - command = "git clone https://github.com/privacyguides/i18n i18n-download && cp -rl i18n-download/i18n . && cp -rl i18n-download/includes . && cp -rl i18n-download/theme . && for i in config/mkdocs.*.yml; do mkdocs build --config-file $i; done && cp -r static/* site/" + command = "crowdin download && for i in config/mkdocs.*.yml; do mkdocs build --config-file $i; done && cp -r static/* site/" [[headers]] @@ -73,6 +73,11 @@ to = "/i18n/404.nl.html" status = 404 +[[redirects]] + from = "/zh-hant/*" + to = "/i18n/404.zh-Hant.html" + status = 404 + [[redirects]] from = "/*" to = "/i18n/404.en.html" diff --git a/static/_redirects b/static/_redirects index f605e6e4..78c3358f 100644 --- a/static/_redirects +++ b/static/_redirects @@ -18,13 +18,14 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -/ /en/ 302 Language=en -/ /es/ 302 Language=es -/ /fr/ 302 Language=fr -/ /he/ 302 Language=he -/ /it/ 302 Language=it -/ /nl/ 302 Language=nl -/ /en/ 302 +/ /en/ 302 Language=en +/ /es/ 302 Language=es +/ /fr/ 302 Language=fr +/ /he/ 302 Language=he +/ /it/ 302 Language=it +/ /nl/ 302 Language=nl +/ /zh-hant/ 302 Language=zh-Hant +/ /en/ 302 /.well-known/matrix/* https://matrix.privacyguides.org/.well-known/matrix/:splat 200 /.well-known/* /well-known/:splat 200 diff --git a/theme/assets/stylesheets/lang-zh-Hant.css b/theme/assets/stylesheets/lang-zh-Hant.css new file mode 100644 index 00000000..18e00037 --- /dev/null +++ b/theme/assets/stylesheets/lang-zh-Hant.css @@ -0,0 +1,58 @@ +/* +/// Copyright (c) 2023 Jonah Aragon +/// +/// 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 +*/ + +/* chinese-traditional */ +@font-face { + font-family: 'Noto Serif TC'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.bunny.net/noto-serif-tc/files/noto-serif-tc-chinese-traditional-400-normal.woff2) format('woff2'), url(https://fonts.bunny.net/noto-serif-tc/files/noto-serif-tc-chinese-traditional-400-normal.woff) format('woff'); +} + +/* latin */ +@font-face { + font-family: 'Noto Serif TC'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.bunny.net/noto-serif-tc/files/noto-serif-tc-latin-400-normal.woff2) format('woff2'), url(https://fonts.bunny.net/noto-serif-tc/files/noto-serif-tc-latin-400-normal.woff) format('woff'); +} + +/* chinese-traditional */ +@font-face { + font-family: 'Noto Serif TC'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.bunny.net/noto-serif-tc/files/noto-serif-tc-chinese-traditional-700-normal.woff2) format('woff2'), url(https://fonts.bunny.net/noto-serif-tc/files/noto-serif-tc-chinese-traditional-700-normal.woff) format('woff'); +} + +/* latin */ +@font-face { + font-family: 'Noto Serif TC'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.bunny.net/noto-serif-tc/files/noto-serif-tc-latin-700-normal.woff2) format('woff2'), url(https://fonts.bunny.net/noto-serif-tc/files/noto-serif-tc-latin-700-normal.woff) format('woff'); +} + +h1, h2, h3, .md-header__topic { + font-family: "Bagnard", "Noto Serif TC", serif; + font-weight: 700!important; +} diff --git a/theme/main.html b/theme/main.html index 4c4245ac..41b468c7 100644 --- a/theme/main.html +++ b/theme/main.html @@ -139,5 +139,10 @@

Je bekijkt de Nederlandse versie van Privacy Guides, vertaald door ons fantastische taalteam op Crowdin. Als u een fout opmerkt of onvertaalde gedeelten op deze pagina ziet, overweeg dan om te helpen! Voor meer informatie en tips zie onze vertaalgids.

You're viewing the Dutch copy of Privacy Guides, translated by our fantastic language team on Crowdin. If you notice an error, or see any untranslated sections on this page, please consider helping out! For more information and tips see our translation guide.

+ {% elif config.theme.language == "zh-Hant" %} +
+

您正在查看由我們在Crowdin上出色的語言團隊翻譯的《隱私指南》英文版。如果您發現錯誤,或在此頁面上看到任何未翻譯的部分,請考慮提供幫助!有關更多信息和提示,請參閱我們的翻譯指南.

+

You're viewing the Chinese (Traditional) copy of Privacy Guides, translated by our fantastic language team on Crowdin. If you notice an error, or see any untranslated sections on this page, please consider helping out! For more information and tips see our translation guide.

+
{% endif %} {% endblock %}