From 4eb209cb7d853d7d13e1ee5b2612ef69e4d0c964 Mon Sep 17 00:00:00 2001 From: Yuki Hattori <15963767+yuhattor@users.noreply.github.com> Date: Mon, 19 Jun 2023 07:30:54 +0000 Subject: [PATCH 1/4] fixing #521 default language issue --- layouts/partials/header.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 067b5c8046..cc4d07db5c 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -41,7 +41,7 @@ {{ else }} From fea10a3a213c3a2329fd8e449c3e26f45f11d4c1 Mon Sep 17 00:00:00 2001 From: Yuki Hattori <15963767+yuhattor@users.noreply.github.com> Date: Mon, 19 Jun 2023 10:37:12 +0000 Subject: [PATCH 2/4] Add workflow action to delete unnecessary files to prevent hugo from creating shared 404.html files for the wrong default language --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 26bbc15140..a591823f2e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,6 +26,8 @@ jobs: sed -i "s/^.\{37\} /$i\//g" content/.gitignore; sed -i '/total size\|file list/d' content/.gitignore; done + - name: Delete unnecessary files to prevent hugo from creating shared 404.html files for the wrong default language + run: find content -name '404.md' -not -path 'content/en/404.md' -exec rm {} + - name: Build run: hugo --minify - name: Deploy From 6489be2c418ea79c635980efa360eb3a98639dd1 Mon Sep 17 00:00:00 2001 From: Yuki Hattori <15963767+yuhattor@users.noreply.github.com> Date: Mon, 19 Jun 2023 10:39:17 +0000 Subject: [PATCH 3/4] Reorganized language settings --- config/_default/languages.yaml | 42 +++++++++++++++++----------------- layouts/partials/header.html | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/config/_default/languages.yaml b/config/_default/languages.yaml index cd8f6fa0d8..9edf73bfbf 100644 --- a/config/_default/languages.yaml +++ b/config/_default/languages.yaml @@ -1,36 +1,36 @@ en: languageName: English contentDir: content/en - weight: 1 + weight: 10 +fr: + languageName: Français + contentDir: content/fr + weight: 20 ja: languageName: 日本語 contentDir: content/ja - weight: 2 + weight: 20 de: languageName: Deutsch contentDir: content/de - weight: 3 -zh: - languageName: 中文 - contentDir: content/zh - weight: 3 -it: - languageName: Italiano - contentDir: content/it - weight: 3 + weight: 30 es: languageName: Español contentDir: content/es - weight: 3 -ru: - languageName: Русский - contentDir: content/ru - weight: 3 -fr: - languageName: Français - contentDir: content/fr - weight: 3 + weight: 30 +it: + languageName: Italiano + contentDir: content/it + weight: 30 pt-br: languageName: Português Brasileiro contentDir: content/pt-br - weight: 3 \ No newline at end of file + weight: 30 +ru: + languageName: Русский + contentDir: content/ru + weight: 30 +zh: + languageName: 中文 + contentDir: content/zh + weight: 30 \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index cc4d07db5c..6a3e150d06 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -41,7 +41,7 @@ {{ else }} From e5642849ea0a648687a92c4b748a212a1d484b01 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Mon, 19 Jun 2023 21:38:46 +0900 Subject: [PATCH 4/4] Update temporary script --- .github/workflows/main.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a591823f2e..0b4a9c2507 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,10 +26,14 @@ jobs: sed -i "s/^.\{37\} /$i\//g" content/.gitignore; sed -i '/total size\|file list/d' content/.gitignore; done - - name: Delete unnecessary files to prevent hugo from creating shared 404.html files for the wrong default language - run: find content -name '404.md' -not -path 'content/en/404.md' -exec rm {} + - name: Build - run: hugo --minify + run: | + # Delete unnecessary files to prevent hugo from creating shared 404.html files for the wrong default language - Temporary fix + find content -name '404.md' -not -path 'content/en/404.md' -exec rm {} + + # Build + hugo --minify + # Append language options to public/404.html - Temporary fix + sed -i 's||&|g' public/404.html - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: