innersourcecommons.org
innersourcecommons.org copied to clipboard
[WIP] Fixing #521 default language issue
It looks the following issue "Custom 404 per language" is related to this one
The following pages have been updated.
- This is due to the fact that hugo currently does not support 404 pages in multiple languages. There is nothing we can do about it.
- If this is not resolved, the language with the top hit locale ID in descending order will be the default language.
- To fix this, I made a change to always make English the default 404 page language. Specifically, prevent 404 pages from being created in any language other than English, and add an option to the menu of the resulting page after running hugo
- This build script is a bit of a hack, but I would like to wait for the implementation on the hugo side, but this should be fine for the time being.
- Besides that, we changed the language priority. Specifically, they are now in alphabetical order.
# 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">Japanese</option>|g' public/404.html
https://github.com/InnerSourceCommons/innersourcecommons.org/assets/15963767/6d8ce1d2-438f-4a5b-b8f9-cca9cfd8b30d
prevent 404 pages from being created in any language other than English
What part of the code changes accomplishes this?
will take a look at the issue again...