mirror of
https://github.com/privacyguides/privacyguides.org.git
synced 2026-11-05 11:35:44 +00:00
Compare commits
1
Commits
main
...
pr-enable-jp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68d486eaa3 |
No files matched your search
@@ -80,7 +80,7 @@ jobs:
|
||||
needs: [submodule, metadata]
|
||||
strategy:
|
||||
matrix:
|
||||
lang: [es, fr, he, it, nl, ru, zh-Hant, zh-TW]
|
||||
lang: [es, fr, he, it, jp, nl, ru, zh-Hant, zh-TW]
|
||||
fail-fast: false
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
|
||||
@@ -424,7 +424,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
lang: [en, es, fr, he, it, nl, ru, zh-Hant]
|
||||
lang: [en, es, fr, he, it, jp, nl, ru, zh-Hant]
|
||||
|
||||
steps:
|
||||
- name: Add GitHub Token to Environment
|
||||
|
||||
@@ -50,7 +50,7 @@ jobs:
|
||||
needs: submodule
|
||||
strategy:
|
||||
matrix:
|
||||
lang: [en, es, fr, he, it, nl, ru, zh-Hant, zh-TW]
|
||||
lang: [en, es, fr, he, it, jp, nl, ru, zh-Hant, zh-TW]
|
||||
build: [build]
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
+7
-3
@@ -193,6 +193,10 @@ extra:
|
||||
link: /nl/
|
||||
lang: nl
|
||||
icon: https://raw.githubusercontent.com/twitter/twemoji/master/assets/svg/1f1f3-1f1f1.svg
|
||||
- name: 日本語
|
||||
link: /jp/
|
||||
lang: jp
|
||||
icon: https://raw.githubusercontent.com/twitter/twemoji/master/assets/svg/1f1ef-1f1f5.svg
|
||||
- name: 中文 (繁體)
|
||||
link: /zh-hant/
|
||||
lang: zh-Hant
|
||||
@@ -313,7 +317,7 @@ markdown_extensions:
|
||||
custom_fences:
|
||||
- name: mermaid
|
||||
class: mermaid
|
||||
format: !!python/name:pymdownx.superfences.fence_code_format
|
||||
format: !!python/name:pymdownx.superfences.fence_code_format
|
||||
pymdownx.tabbed:
|
||||
alternate_style: true
|
||||
pymdownx.arithmatex:
|
||||
@@ -334,8 +338,8 @@ markdown_extensions:
|
||||
meta: {}
|
||||
abbr: {}
|
||||
pymdownx.emoji:
|
||||
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
||||
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
||||
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
||||
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
||||
options:
|
||||
custom_icons:
|
||||
- theme/icons
|
||||
|
||||
@@ -31,45 +31,44 @@ insiders=false
|
||||
export PRODUCTION=false
|
||||
|
||||
# Parse command-line arguments
|
||||
for arg in "$@"
|
||||
do
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
--lang=*)
|
||||
--lang=*)
|
||||
language="${arg#*=}"
|
||||
shift
|
||||
;;
|
||||
--insiders)
|
||||
--insiders)
|
||||
insiders=true
|
||||
shift
|
||||
;;
|
||||
--cmd=*)
|
||||
--cmd=*)
|
||||
base_cmd="${arg#*=}"
|
||||
shift
|
||||
;;
|
||||
--build)
|
||||
--build)
|
||||
build=true
|
||||
shift
|
||||
;;
|
||||
--offline)
|
||||
--offline)
|
||||
offline=true
|
||||
shift
|
||||
;;
|
||||
--production)
|
||||
--production)
|
||||
export PRODUCTION=true
|
||||
shift
|
||||
;;
|
||||
--cmd_flags=*)
|
||||
--cmd_flags=*)
|
||||
cmd_flags+=("${arg#*=}")
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
*)
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Set variables for offline mode
|
||||
if $offline ; then
|
||||
if $offline; then
|
||||
export BUILD_EDIT_URI_TEMPLATE=''
|
||||
export BUILD_OFFLINE=true
|
||||
export BUILD_REPO_URL=''
|
||||
@@ -90,8 +89,8 @@ fi
|
||||
|
||||
# Source per-language strings
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
source "$PWD/includes/strings.$language.env"
|
||||
# shellcheck disable=SC1090
|
||||
source "$PWD/includes/strings.$language.env"
|
||||
set +a
|
||||
|
||||
# Set font if hebrew
|
||||
@@ -100,6 +99,12 @@ if [ "$language" == "he" ]; then
|
||||
export BUILD_THEME_FONT_TEXT="Open Sans"
|
||||
fi
|
||||
|
||||
# set font if japanese
|
||||
if [ "$language" == "jp" ]; then
|
||||
export build_theme_font_code="Noto Sans JP"
|
||||
export build_theme_font_text="Noto Sans JP"
|
||||
fi
|
||||
|
||||
# Set font if russian or chinese
|
||||
if [[ "ru zh-Hant zh-TW" =~ $language ]]; then
|
||||
export BUILD_THEME_FONT_CODE="Noto Sans TC"
|
||||
@@ -107,18 +112,18 @@ if [[ "ru zh-Hant zh-TW" =~ $language ]]; then
|
||||
fi
|
||||
|
||||
# Set stylesheet if hebrew or russian or chinese
|
||||
if [[ "he ru zh-Hant zh-TW" =~ $language ]]; then
|
||||
if [[ "he ru jp zh-Hant zh-TW" =~ $language ]]; then
|
||||
export TRANSLATION_STYLESHEET="assets/stylesheets/lang-$language.css?v=20240410"
|
||||
fi
|
||||
|
||||
# Set theme if insiders
|
||||
if $insiders ; then
|
||||
if $insiders; then
|
||||
export BUILD_INSIDERS=true
|
||||
cmd_flags+=("--config-file=$PWD/mkdocs.insiders.yml")
|
||||
fi
|
||||
|
||||
# Run the command with the specified language
|
||||
if $build ; then
|
||||
if $build; then
|
||||
$base_cmd build "${cmd_flags[@]}"
|
||||
else
|
||||
$base_cmd serve "${cmd_flags[@]}"
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
/// Copyright (c) 2023 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
|
||||
*/
|
||||
|
||||
/* japanese */
|
||||
@font-face {
|
||||
font-family: 'Noto Serif JP';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url(https://cdn.jsdelivr.net/fontsource/fonts/noto-serif-jp@5.3.1/0-400-normal.woff2) format('woff2'), url(https://cdn.jsdelivr.net/fontsource/fonts/noto-serif-jp@5.3.1/0-400-normal.woff) format('woff');
|
||||
}
|
||||
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Noto Serif JP';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url(https://cdn.jsdelivr.net/fontsource/fonts/noto-serif-jp@5.3.1/latin-400-normal.woff2) format('woff2'), url(https://cdn.jsdelivr.net/fontsource/fonts/noto-serif-jp@5.3.1/latin-400-normal.woff) format('woff');
|
||||
}
|
||||
|
||||
/* japanese */
|
||||
@font-face {
|
||||
font-family: 'Noto Serif JP';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: url(https://cdn.jsdelivr.net/fontsource/fonts/noto-serif-jp@5.3.1/0-700-normal.woff2) format('woff2'), url(https://cdn.jsdelivr.net/fontsource/fonts/noto-serif-jp@5.3.1/0-700-normal.woff) format('woff');
|
||||
}
|
||||
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Noto Serif JP';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: url(https://cdn.jsdelivr.net/fontsource/fonts/noto-serif-jp@5.3.1/latin-700-normal.woff2) format('woff2'), url(https://cdn.jsdelivr.net/fontsource/fonts/noto-serif-jp@5.3.1/latin-700-normal.woff) format('woff');
|
||||
}
|
||||
|
||||
h1, h2, h3, .md-header__topic {
|
||||
font-family: "Bagnard", "Noto Serif JP", serif;
|
||||
font-weight: 700!important;
|
||||
}
|
||||
@@ -11,6 +11,8 @@ definitions:
|
||||
- &font_family >-
|
||||
{%- if config.theme.language == "he" -%}
|
||||
Suez One
|
||||
{%- elif config.theme.language == "jp" -%}
|
||||
Noto Serif JP
|
||||
{%- elif config.theme.language == ("ru" or "zh-Hant" or "zh-TW") -%}
|
||||
Noto Sans TC
|
||||
{%- else -%}
|
||||
|
||||
@@ -19,6 +19,8 @@ definitions:
|
||||
- &title_font_family >-
|
||||
{%- if config.theme.language == "he" -%}
|
||||
Suez One
|
||||
{%- elif config.theme.language == "jp" -%}
|
||||
Noto Serif JP
|
||||
{%- elif config.theme.language == ("ru" or "zh-Hant" or "zh-TW") -%}
|
||||
Noto Serif TC
|
||||
{%- else -%}
|
||||
@@ -35,6 +37,8 @@ definitions:
|
||||
- &font_family >-
|
||||
{%- if config.theme.language == "he" -%}
|
||||
Suez One
|
||||
{%- elif config.theme.language == "jp" -%}
|
||||
Noto Serif JP
|
||||
{%- elif config.theme.language == ("ru" or "zh-Hant" or "zh-TW") -%}
|
||||
Noto Sans TC
|
||||
{%- else -%}
|
||||
|
||||
@@ -15,6 +15,8 @@ definitions:
|
||||
- &title_font_family >-
|
||||
{%- if config.theme.language == "he" -%}
|
||||
Suez One
|
||||
{%- elif config.theme.language == "jp" -%}
|
||||
Noto Serif JP
|
||||
{%- elif config.theme.language == ("ru" or "zh-Hant" or "zh-TW") -%}
|
||||
Noto Serif TC
|
||||
{%- else -%}
|
||||
@@ -24,6 +26,8 @@ definitions:
|
||||
- &font_family >-
|
||||
{%- if config.theme.language == "he" -%}
|
||||
Suez One
|
||||
{%- elif config.theme.language == "jp" -%}
|
||||
Noto Serif JP
|
||||
{%- elif config.theme.language == ("ru" or "zh-Hant" or "zh-TW") -%}
|
||||
Noto Sans TC
|
||||
{%- else -%}
|
||||
|
||||
@@ -19,6 +19,8 @@ definitions:
|
||||
- &title_font_family >-
|
||||
{%- if config.theme.language == "he" -%}
|
||||
Suez One
|
||||
{%- elif config.theme.language == "jp" -%}
|
||||
Noto Serif JP
|
||||
{%- elif config.theme.language == ("ru" or "zh-Hant" or "zh-TW") -%}
|
||||
Noto Serif TC
|
||||
{%- else -%}
|
||||
@@ -35,6 +37,8 @@ definitions:
|
||||
- &font_family >-
|
||||
{%- if config.theme.language == "he" -%}
|
||||
Suez One
|
||||
{%- elif config.theme.language == "jp" -%}
|
||||
Noto Serif JP
|
||||
{%- elif config.theme.language == ("ru" or "zh-Hant" or "zh-TW") -%}
|
||||
Noto Sans TC
|
||||
{%- else -%}
|
||||
|
||||
Reference in new issue
Block a user