From eff1d022f289d5a1601e2222e38eb07764ac2d03 Mon Sep 17 00:00:00 2001 From: Tatsunori Uchino Date: Tue, 30 Sep 2025 22:57:36 +0900 Subject: [PATCH 1/2] fix(scss): limit `--zh-font-family` to only simplified Chinese --- assets/scss/variables.scss | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/assets/scss/variables.scss b/assets/scss/variables.scss index 97810a1d3..7aa6e20b6 100644 --- a/assets/scss/variables.scss +++ b/assets/scss/variables.scss @@ -43,8 +43,13 @@ $defaultTagColors: #fff, #fff, #fff, #fff, #fff; --sys-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Droid Sans", "Helvetica Neue"; --zh-font-family: "PingFang SC", "Hiragino Sans GB", "Droid Sans Fallback", "Microsoft YaHei"; - --base-font-family: "Lato", var(--sys-font-family), var(--zh-font-family), sans-serif; - --code-font-family: Menlo, Monaco, Consolas, "Courier New", var(--zh-font-family), monospace; + --base-font-family: "Lato", var(--sys-font-family), sans-serif; + --code-font-family: Menlo, Monaco, Consolas, "Courier New", monospace; +} + +:root:where(:lang(zh):not(:is(:lang(zh-Hant), :lang(zh-TW), :lang(zh-HK), :lang(zh-MO)))) { + --base-font-family: "Lato", var(--sys-font-family), var(--zh-font-family, ""), sans-serif; + --code-font-family: Menlo, Monaco, Consolas, "Courier New", var(--zh-font-family, ""), monospace; } /* From beeb0df470361b990097e784a291aa93b8af97ee Mon Sep 17 00:00:00 2001 From: Tatsunori Uchino Date: Tue, 30 Sep 2025 22:59:17 +0900 Subject: [PATCH 2/2] feat(sampleSite): add test page for Japanese & Traditional Chinese --- exampleSite/content/_index.ja.md | 8 ++++++ exampleSite/content/_index.zh-tw.md | 8 ++++++ .../content/post/chinese-test/index.ja.md | 26 +++++++++++++++++++ .../content/post/chinese-test/index.zh-cn.md | 6 ++++- .../content/post/chinese-test/index.zh-tw.md | 14 ++++++++++ exampleSite/hugo.yaml | 18 ++++++++++++- 6 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 exampleSite/content/_index.ja.md create mode 100644 exampleSite/content/_index.zh-tw.md create mode 100644 exampleSite/content/post/chinese-test/index.ja.md create mode 100644 exampleSite/content/post/chinese-test/index.zh-tw.md diff --git a/exampleSite/content/_index.ja.md b/exampleSite/content/_index.ja.md new file mode 100644 index 000000000..7b6ff065e --- /dev/null +++ b/exampleSite/content/_index.ja.md @@ -0,0 +1,8 @@ +--- +menu: + main: + name: ホーム + weight: -100 + params: + icon: home +--- \ No newline at end of file diff --git a/exampleSite/content/_index.zh-tw.md b/exampleSite/content/_index.zh-tw.md new file mode 100644 index 000000000..65e177b3c --- /dev/null +++ b/exampleSite/content/_index.zh-tw.md @@ -0,0 +1,8 @@ +--- +menu: + main: + name: 主頁 + weight: -100 + params: + icon: home +--- \ No newline at end of file diff --git a/exampleSite/content/post/chinese-test/index.ja.md b/exampleSite/content/post/chinese-test/index.ja.md new file mode 100644 index 000000000..28135e35d --- /dev/null +++ b/exampleSite/content/post/chinese-test/index.ja.md @@ -0,0 +1,26 @@ +--- +title: Japanese Test +description: これはサブタイトル +date: 2020-09-09 +slug: test-chinese +image: helena-hertz-wWZzXlDpMog-unsplash.jpg +categories: + - Test + - テスト +--- + +## 本文テスト(フォント) + +返扇花週認契適違込遷雇述請曜藤突扉直角 + +## 引用 + +> 国破れて山河在り\ +> 城春にして草木深し\ +> 時に感じては花にも涙を濺ぎ\ +> 別れを恨んでは鳥にも心を驚かす +> +> 烽火三月に連なり\ +> 家書万金に抵たる\ +> 白頭掻けば更に短く\ +> 渾べて簪に勝へざらんと欲す diff --git a/exampleSite/content/post/chinese-test/index.zh-cn.md b/exampleSite/content/post/chinese-test/index.zh-cn.md index 5249ef890..c319b5853 100644 --- a/exampleSite/content/post/chinese-test/index.zh-cn.md +++ b/exampleSite/content/post/chinese-test/index.zh-cn.md @@ -36,4 +36,8 @@ categories: ![Photo by Helena Hertz on Unsplash](helena-hertz-wWZzXlDpMog-unsplash.jpg) ![Photo by Hudai Gayiran on Unsplash](hudai-gayiran-3Od_VKcDEAA-unsplash.jpg) ``` -相册语法来自 [Typlog](https://typlog.com/) \ No newline at end of file +相册语法来自 [Typlog](https://typlog.com/) + +## 字体 + +返扇花週認契適違込遷雇述請曜藤突扉直角 diff --git a/exampleSite/content/post/chinese-test/index.zh-tw.md b/exampleSite/content/post/chinese-test/index.zh-tw.md new file mode 100644 index 000000000..09087aff5 --- /dev/null +++ b/exampleSite/content/post/chinese-test/index.zh-tw.md @@ -0,0 +1,14 @@ +--- +title: Chinese Test +description: 這是一個副標題 +date: 2020-09-09 +slug: test-chinese +image: helena-hertz-wWZzXlDpMog-unsplash.jpg +categories: + - Test + - 測試 +--- + +## 正文測試(字體) + +返扇花週認契適違込遷雇述請曜藤突扉直角 diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index 7cda528c3..0ec4ed0b3 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -21,12 +21,28 @@ languages: sidebar: subtitle: Example description zh-cn: - languageName: 中文 + languageName: 简体中文 title: 演示站点 weight: 2 params: sidebar: subtitle: 演示说明 + + zh-tw: + languageName: 正體中文 + title: 演示站點 + weight: 2 + params: + sidebar: + subtitle: 演示說明 + + ja: + languageName: 日本語 + title: サンプルサイト + weight: 2 + params: + sidebar: + subtitle: サンプル説明 ar: languageName: عربي languagedirection: rtl