* feat: archives page * fix: empty archive show 'no posts found' message * Add ToC partials for structural consistency * Fix empty archive showing blank page * fix: rename archive to archives * chore: enhance archives and additional pages support - Updated the menu structure in hugo.yaml to include new sections for 'About', 'Archives', and 'Glossary' under 'More'. - Added new archive index files for multiple languages (Farsi, Japanese, Simplified Chinese) to support multilingual content. - Created additional pages documentation for glossary and archives in multiple languages. - Updated references in existing documentation to point to the new additional pages structure. - Improved the archives layout to display a user-friendly message when no posts are found. * fix: update date format in archives layout - Changed the date format in the archives layout from a partial to a direct format for improved readability, displaying dates as "Jan 02". * feat: add archive date format customization - Introduced a new parameter in hugo.yaml for customizing the date format of archive items, defaulting to "Jan 02". - Updated documentation in multiple languages to reflect the new optional date format feature for archives. --------- Co-authored-by: Xin <xin@imfing.com>
2.4 KiB
title, weight, prev
| title | weight | prev |
|---|---|---|
| Multi-language | 1 | /docs/advanced/additional-pages |
Hextra supports creating site with multiple languages using Hugo's multilingual mode.
Enable Multi-language
To make our site multi-language, we need to tell Hugo the supported languages. We need to add to the site configuration file:
defaultContentLanguage: en
languages:
en:
languageName: English
weight: 1
fr:
languageName: Français
weight: 2
ja:
languageName: 日本語
weight: 3
Manage Translations by Filename
Hugo supports managing translations by filename. For example, if we have a file content/docs/_index.md in English, we can create a file content/docs/_index.fr.md for French translation.
{{< filetree/container >}} {{< filetree/folder name="content" >}} {{< filetree/folder name="docs" state="open" >}} {{< filetree/file name="_index.md" >}} {{< filetree/file name="_index.fr.md" >}} {{< filetree/file name="_index.ja.md" >}} {{< /filetree/folder >}} {{< /filetree/folder >}} {{< /filetree/container >}}
Note: Hugo also supports Translation by content directory.
Translate Menu Items
To translate menu items in the navigation bar, we need to set the identifier field:
menu:
main:
- identifier: documentation
name: Documentation
pageRef: /docs
weight: 1
- identifier: blog
name: Blog
pageRef: /blog
weight: 2
and translate them in the corresponding i18n file:
documentation: Documentation
blog: Blog
Translate Strings
To translate strings on the other places, we need to add the translation to the corresponding i18n file:
readMore: Lire la suite
A list of strings used in the theme can be found in the i18n/en.yaml file.