Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fixing #521 default language issue #567

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ jobs:
sed -i '/total size\|file list/d' content/.gitignore;
done
- 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|<option>English</option>|&<option value="/fr">Français</option><option value="/ja">日本語</option>|g' public/404.html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
42 changes: 21 additions & 21 deletions config/_default/languages.yaml
Original file line number Diff line number Diff line change
@@ -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
weight: 30
ru:
languageName: Русский
contentDir: content/ru
weight: 30
zh:
languageName: 中文
contentDir: content/zh
weight: 30
2 changes: 1 addition & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{{ else }}
<select id="langpicker" class="selectpicker" data-style="btn-light btn-sm ml-3" data-width="fit">
<option>{{ .Site.Language.LanguageName }}</option>
{{ range where .Translations ".Language.LanguageName" "in" "English 日本語 Français"}}
{{ range where .Translations ".Language.LanguageName" "in" "English Français 日本語"}}
<option value="{{ .Permalink }}">{{ .Language.LanguageName }}</option>
{{ end }}
</select>
Expand Down