From a03fba756761426825d23b4cc63159e00e1ba73e Mon Sep 17 00:00:00 2001 From: Melora Hugues Date: Mon, 19 Jun 2023 14:17:13 +0200 Subject: [PATCH] Add multilanguage support Enable multilanguage support with two separate (/en and /fr) base directories containing each a sample article --- config.toml | 42 ++++++++++++++++++++++++++-- content/{ => en}/posts/first-post.md | 0 content/fr/posts/premier-post.md | 16 +++++++++++ 3 files changed, 55 insertions(+), 3 deletions(-) rename content/{ => en}/posts/first-post.md (100%) create mode 100644 content/fr/posts/premier-post.md diff --git a/config.toml b/config.toml index 8fa2dd7..3ff447d 100644 --- a/config.toml +++ b/config.toml @@ -1,4 +1,40 @@ -baseURL = "http://example.org/" +baseURL = "https://faercol.me" languageCode = "en-us" -title = "My New Hugo Site" -theme = "hello-friend-ng" \ No newline at end of file +defaultContentLanguage = "en" +defaultContentLanguageInSubdir = true +title = "Melora Hugues" +theme = "hello-friend-ng" +paginate = 10 + +[params] + dateform = "2 Jan 2006" + dateformShort = "2 Jan" + dateformNum = "02-01-2006" + dateformNumTime = "02-01-2006 15:04" + + homeSubtitle = "Personal website and tech blog" + disableReadOtherPosts = false + enableSharingButtons = true + enableGlobalLanguageMenu = true + + description = "Melora Hugues - Personal website and tech blog" + keywords = "blog, tech, dev" + images = [""] + +[taxonomies] + category = "blog" + tags = "tags" + series = "series" + +[languages] + [languages.en] + contentDir = "content/en" + + [languages.fr] + contentDir = "content/fr" + title = "Mon blog" + +[[menu.main]] + identifier = "blog" + name = "Blog" + url = "/posts" diff --git a/content/posts/first-post.md b/content/en/posts/first-post.md similarity index 100% rename from content/posts/first-post.md rename to content/en/posts/first-post.md diff --git a/content/fr/posts/premier-post.md b/content/fr/posts/premier-post.md new file mode 100644 index 0000000..974a69b --- /dev/null +++ b/content/fr/posts/premier-post.md @@ -0,0 +1,16 @@ +--- +title: "Premier Post" +date: 2023-06-19T11:37:35+02:00 +draft: true +--- + +## Titre + +Ceci est mon contenu + +```python +def method(args): + print("toto") + return args +``` +