Iβm using the congo theme with two languages: en and zh-tw. In the latest update, the theme changes the language code from zh-tw to zh-Hant.
To accommodate the latest change, Iβm thinking of changing all zh-tw to zh-Hant and specifying the baseURL parameters on both languages like so:
# languages.zh-Hant.toml
baseURL = "https://blog.tomy.me/zh-tw/"
languageCode = "zh-Hant"
languageName = "πΉπΌ δΈζ (ε°η£)"
languageDirection = "ltr"
weight = 1
hasCJKLanguage = true
...
# languages.en.toml
baseURL = "https://blog.tomy.me/en/"
languageCode = "en"
languageName = "πΊπΈ English (US)"
languageDirection = "ltr"
weight = 2
hasCJKLanguage = false
...
Just so that it will still serve my website as follows as it always has been:
- English site:
https://blog.tomy.me/en/ - Chinese site:
https://blog.tomy.me/zh-tw/
This works fine on local with hugo server:
| ZH-HANT | EN
-------------------+---------+------
Pages | 261 | 48
Paginator pages | 24 | 0
Non-page files | 326 | 21
Static files | 8 | 8
Processed images | 2207 | 100
Aliases | 73 | 8
Cleaned | 100 | 100
Built in 9320 ms
Environment: "development"
Serving pages from disk
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/zh-tw/ (bind address 127.0.0.1) zh-hant
Web Server is available at http://localhost:1314/en/ (bind address 127.0.0.1) en
Press Ctrl+C to stop
But when I attempt to build it, the built site looks something like this:
public
βββ en
β βββ css
β βββ img
β βββ index.html
β βββ index.json
β βββ index.xml
β βββ js
β βββ lib
β βββ posts
β βββ ...(omitted)
βββ zh-hant
βββ css
βββ img
βββ index.html
βββ index.json
βββ index.xml
βββ js
βββ lib
βββ posts
βββ ...(omitted)
The Chinese site is being built at /zh-Hant ![]()
When I inspect the built pages, I notice the baseURL parameter is in effect that most anchor to static assets are correct, such as <script src=/zh-tw/js/main.bundle.min.f64817246a3814fe8ac69eaa744f58dafd97df187e7f28274423d3de185d4625.js></script>.
I can hotfix this issue by just simply renaming the zh-Hant to zh-tw, but the question is: How should I configure Hugo to build it as I wish?