From 7f530013f0b602a89eaead832a9413bf2daa8469 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 9 Oct 2023 19:18:04 +0200 Subject: [PATCH] basic multilanguages settings --- config/_default/languages.toml | 15 ++++++-- config/_default/menus.fr.toml | 64 ++++++++++++++++++++++++++++++++++ config/_default/menus.nl.toml | 64 ++++++++++++++++++++++++++++++++++ hugo.toml | 2 +- 4 files changed, 142 insertions(+), 3 deletions(-) create mode 100755 config/_default/menus.fr.toml create mode 100755 config/_default/menus.nl.toml diff --git a/config/_default/languages.toml b/config/_default/languages.toml index fc8d07f..4a0cdab 100755 --- a/config/_default/languages.toml +++ b/config/_default/languages.toml @@ -1,6 +1,17 @@ -################ English language ################## +[fr] +languageName = "Fr" +languageCode = "fr-be" +contentDir = "content/francais" +weight = 1 + +[nl] +languageName = "Nl" +languageCode = "nl-be" +contentDir = "content/nederlands" +weight = 2 + [en] languageName = "En" languageCode = "en-us" contentDir = "content/english" -weight = 1 +weight = 3 diff --git a/config/_default/menus.fr.toml b/config/_default/menus.fr.toml new file mode 100755 index 0000000..ece17d1 --- /dev/null +++ b/config/_default/menus.fr.toml @@ -0,0 +1,64 @@ +############# English navigation ############## + +# main menu +[[main]] +name = "Accueil" +url = "/" +weight = 1 + +[[main]] +name = "À propos" +url = "about/" +weight = 2 + +[[main]] +name = "Éléments" +url = "elements/" +weight = 3 + +[[main]] +name = "Pages" +hasChildren = true +weight = 4 + +[[main]] +parent = "Pages" +name = "Blog" +url = "blog/" + +[[main]] +parent = "Pages" +name = "Contact" +url = "contact/" + +[[main]] +parent = "Pages" +name = "Auteurs" +url = "authors/" + +[[main]] +parent = "Pages" +name = "Catégories" +url = "categories/" + +[[main]] +parent = "Pages" +name = "Page 404" +url = "404/" + + +# footer menu +[[footer]] +name = "À propos" +url = "about/" +weight = 1 + +[[footer]] +name = "Éléments" +url = "elements/" +weight = 2 + +[[footer]] +name = "Vie privée" +url = "privacy-policy/" +weight = 3 diff --git a/config/_default/menus.nl.toml b/config/_default/menus.nl.toml new file mode 100755 index 0000000..daca28f --- /dev/null +++ b/config/_default/menus.nl.toml @@ -0,0 +1,64 @@ +############# English navigation ############## + +# main menu +[[main]] +name = "Home" +url = "/" +weight = 1 + +[[main]] +name = "About" +url = "about/" +weight = 2 + +[[main]] +name = "Elements" +url = "elements/" +weight = 3 + +[[main]] +weight = 4 +name = "Pages" +hasChildren = true + +[[main]] +parent = "Pages" +name = "Blog" +url = "blog/" + +[[main]] +parent = "Pages" +name = "Contact" +url = "contact/" + +[[main]] +parent = "Pages" +name = "Authors" +url = "authors/" + +[[main]] +parent = "Pages" +name = "Categories" +url = "categories/" + +[[main]] +parent = "Pages" +name = "404 Page" +url = "404/" + + +# footer menu +[[footer]] +name = "About" +url = "about/" +weight = 1 + +[[footer]] +name = "Elements" +url = "elements/" +weight = 2 + +[[footer]] +name = "Privacy Policy" +url = "privacy-policy/" +weight = 3 diff --git a/hugo.toml b/hugo.toml index 3e84f4e..2badd31 100755 --- a/hugo.toml +++ b/hugo.toml @@ -19,7 +19,7 @@ disqusShortname = "themefisher-template" # we use disqus to show comments in blo disableLanguages = [ ] # example: ["fr"] for disable french language. see https://gohugo.io/content-management/multilingual/ hasCJKLanguage = false # If hasCJKLanguage true, auto-detect Chinese/Japanese/Korean Languages in the content. see: https://gohugo.io/getting-started/configuration/#hascjklanguage - +defaultContentLanguage = "fr" ########################## Permalinks ############################ [permalinks.page]