mykiwi/mykiwi.blogpublic Fork 0
479f7e2
Commits
Clone
git clone https://git.rickub.com/mykiwi/mykiwi.blog.git
git clone ssh://git@rickub.com/mykiwi/mykiwi.blog.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Add Spanish (es) language support

Same multihost pattern as fr/pt/ja: its own baseURL/subdomain in
hugo.toml, UI string translations, a Cloudflare Pages project/domain/DNS
record in infra/, and a leg in the deploy loop. No content posts are
translated yet, matching fr/pt/ja's current state.
Romain Gautier committed 2026-09-18T19:58:05+02:00 Browse files
479f7e2 parent: a74fe0a
modified blog/hugo.toml +30 -14
@@ -5,12 +5,12 @@ enableRobotsTXT = true
55 # Multihost: every language below sets its own baseURL, which is what tells
66 # Hugo to build each one as a fully separate site (own absolute URLs, no
77 # /fr/ path prefix) instead of one shared build with a language-prefixed
8-# path. `hugo` then writes public/en/, public/fr/, public/pt/, public/ja/ -
9-# each folder is a complete site meant to be deployed as the docroot of its
10-# own (sub)domain (public/en/ -> mykiwi.blog, public/fr/ -> fr.mykiwi.blog,
11-# etc). A content file with no language suffix (e.g. posts/hello-world.md)
12-# is the English version; translations sit alongside it as
13-# posts/hello-world.fr.md, .pt.md, .ja.md.
8+# path. `hugo` then writes public/en/, public/fr/, public/pt/, public/ja/,
9+# public/es/ - each folder is a complete site meant to be deployed as the
10+# docroot of its own (sub)domain (public/en/ -> mykiwi.blog, public/fr/ ->
11+# fr.mykiwi.blog, etc). A content file with no language suffix (e.g.
12+# posts/hello-world.md) is the English version; translations sit alongside
13+# it as posts/hello-world.fr.md, .pt.md, .ja.md, .es.md.
1414 defaultContentLanguage = "en"
1515
1616 [languages.en]
@@ -19,23 +19,29 @@ label = "English"
1919 locale = "en-us"
2020 weight = 1
2121
22+[languages.es]
23+baseURL = "https://es.mykiwi.blog/"
24+label = "Español"
25+locale = "es-es"
26+weight = 2
27+
2228 [languages.fr]
2329 baseURL = "https://fr.mykiwi.blog/"
2430 label = "Français"
2531 locale = "fr-fr"
26-weight = 2
32+weight = 3
2733
2834 [languages.pt]
2935 baseURL = "https://pt.mykiwi.blog/"
3036 label = "Português"
3137 locale = "pt-br"
32-weight = 3
38+weight = 4
3339
3440 [languages.ja]
3541 baseURL = "https://ja.mykiwi.blog/"
3642 label = "日本語"
3743 locale = "ja-jp"
38-weight = 4
44+weight = 5
3945
4046 [params]
4147 # Optional: overrides the <meta name="description"> tag with different text
@@ -62,24 +68,34 @@ atprotoHandle = 'mykiwi.dev'
6268 bio = "I'm a software engineer, passionate about technology, sharing knowledge and open source like #PHP, #Symfony, #Docker, #Dagger, #Nix and atproto:// Also [🐕️ & 🐈️](https://instagram.com/apy.leon \"Pictures of Apy & Léon\") dad."
6369
6470 [[params.profile.links]]
65-key = "bluesky"
71+key = "Tweets on ATmosphere"
6672 value = "@mykiwi.dev"
6773 url = "https://bsky.app/profile/mykiwi.dev"
6874
6975 [[params.profile.links]]
70-key = "tangled"
76+key = "Tweets on Fediverse"
77+value = "@mykiwi@mamot.fr"
78+url = "https://mamot.fr/@mykiwi"
79+
80+[[params.profile.links]]
81+key = "Tweets on Twitter"
82+value = "@mykiwi"
83+url = "https://x.com/mykiwi"
84+
85+[[params.profile.links]]
86+key = "Code on ATmosphere"
7187 value = "@mykiwi.dev"
7288 url = "https://tangled.org/mykiwi.dev"
7389
7490 [[params.profile.links]]
75-key = "github"
76-value = "mykiwi"
91+key = "Code on GitHub"
92+value = "@mykiwi"
7793 url = "https://github.com/mykiwi"
7894
7995 [[params.profile.links]]
8096 key = "email"
8197 value = "hi@mykiwi.blog"
82-url = "mailto:you@example.com"
98+url = "mailto:hi@mykiwi.blog"
8399
84100 [markup.highlight]
85101 noClasses = false
@@ -5,12 +5,12 @@ enableRobotsTXT = true
5 # Multihost: every language below sets its own baseURL, which is what tells5 # Multihost: every language below sets its own baseURL, which is what tells
6 # Hugo to build each one as a fully separate site (own absolute URLs, no6 # Hugo to build each one as a fully separate site (own absolute URLs, no
7 # /fr/ path prefix) instead of one shared build with a language-prefixed7 # /fr/ path prefix) instead of one shared build with a language-prefixed
8-# path. `hugo` then writes public/en/, public/fr/, public/pt/, public/ja/ -8+# path. `hugo` then writes public/en/, public/fr/, public/pt/, public/ja/,
9-# each folder is a complete site meant to be deployed as the docroot of its9+# public/es/ - each folder is a complete site meant to be deployed as the
10-# own (sub)domain (public/en/ -> mykiwi.blog, public/fr/ -> fr.mykiwi.blog,10+# docroot of its own (sub)domain (public/en/ -> mykiwi.blog, public/fr/ ->
11-# etc). A content file with no language suffix (e.g. posts/hello-world.md)11+# fr.mykiwi.blog, etc). A content file with no language suffix (e.g.
12-# is the English version; translations sit alongside it as12+# posts/hello-world.md) is the English version; translations sit alongside
13-# posts/hello-world.fr.md, .pt.md, .ja.md.13+# it as posts/hello-world.fr.md, .pt.md, .ja.md, .es.md.
14 defaultContentLanguage = "en"14 defaultContentLanguage = "en"
15 15
16 [languages.en]16 [languages.en]
@@ -19,23 +19,29 @@ label = "English"
19 locale = "en-us"19 locale = "en-us"
20 weight = 120 weight = 1
21 21
22+[languages.es]
23+baseURL = "https://es.mykiwi.blog/"
24+label = "Español"
25+locale = "es-es"
26+weight = 2
27+
22 [languages.fr]28 [languages.fr]
23 baseURL = "https://fr.mykiwi.blog/"29 baseURL = "https://fr.mykiwi.blog/"
24 label = "Français"30 label = "Français"
25 locale = "fr-fr"31 locale = "fr-fr"
26-weight = 232+weight = 3
27 33
28 [languages.pt]34 [languages.pt]
29 baseURL = "https://pt.mykiwi.blog/"35 baseURL = "https://pt.mykiwi.blog/"
30 label = "Português"36 label = "Português"
31 locale = "pt-br"37 locale = "pt-br"
32-weight = 338+weight = 4
33 39
34 [languages.ja]40 [languages.ja]
35 baseURL = "https://ja.mykiwi.blog/"41 baseURL = "https://ja.mykiwi.blog/"
36 label = "日本語"42 label = "日本語"
37 locale = "ja-jp"43 locale = "ja-jp"
38-weight = 444+weight = 5
39 45
40 [params]46 [params]
41 # Optional: overrides the <meta name="description"> tag with different text47 # Optional: overrides the <meta name="description"> tag with different text
@@ -62,24 +68,34 @@ atprotoHandle = 'mykiwi.dev'
62 bio = "I'm a software engineer, passionate about technology, sharing knowledge and open source like #PHP, #Symfony, #Docker, #Dagger, #Nix and atproto:// Also [🐕️ & 🐈️](https://instagram.com/apy.leon \"Pictures of Apy & Léon\") dad."68 bio = "I'm a software engineer, passionate about technology, sharing knowledge and open source like #PHP, #Symfony, #Docker, #Dagger, #Nix and atproto:// Also [🐕️ & 🐈️](https://instagram.com/apy.leon \"Pictures of Apy & Léon\") dad."
63 69
64 [[params.profile.links]]70 [[params.profile.links]]
65-key = "bluesky"71+key = "Tweets on ATmosphere"
66 value = "@mykiwi.dev"72 value = "@mykiwi.dev"
67 url = "https://bsky.app/profile/mykiwi.dev"73 url = "https://bsky.app/profile/mykiwi.dev"
68 74
69 [[params.profile.links]]75 [[params.profile.links]]
70-key = "tangled"76+key = "Tweets on Fediverse"
77+value = "@mykiwi@mamot.fr"
78+url = "https://mamot.fr/@mykiwi"
79+
80+[[params.profile.links]]
81+key = "Tweets on Twitter"
82+value = "@mykiwi"
83+url = "https://x.com/mykiwi"
84+
85+[[params.profile.links]]
86+key = "Code on ATmosphere"
71 value = "@mykiwi.dev"87 value = "@mykiwi.dev"
72 url = "https://tangled.org/mykiwi.dev"88 url = "https://tangled.org/mykiwi.dev"
73 89
74 [[params.profile.links]]90 [[params.profile.links]]
75-key = "github"91+key = "Code on GitHub"
76-value = "mykiwi"92+value = "@mykiwi"
77 url = "https://github.com/mykiwi"93 url = "https://github.com/mykiwi"
78 94
79 [[params.profile.links]]95 [[params.profile.links]]
80 key = "email"96 key = "email"
81 value = "hi@mykiwi.blog"97 value = "hi@mykiwi.blog"
82-url = "mailto:you@example.com"98+url = "mailto:hi@mykiwi.blog"
83 99
84 [markup.highlight]100 [markup.highlight]
85 noClasses = false101 noClasses = false
added blog/i18n/es.toml +27 -0
new file mode 100644
@@ -0,0 +1,27 @@
1+[skipToContent]
2+other = "Saltar al contenido"
3+
4+[about]
5+other = "Acerca de"
6+
7+[minRead]
8+other = "{{ .Count }} min de lectura"
9+
10+[postsCount]
11+one = "{{ .Count }} artículo"
12+other = "{{ .Count }} artículos"
13+
14+[licenseText]
15+other = "Texto bajo licencia"
16+
17+[subscribeRSS]
18+other = "Suscribirse vía RSS"
19+
20+[rssLabel]
21+other = "RSS"
22+
23+[latest]
24+other = "Último"
25+
26+[readMore]
27+other = "Leer →"
new file mode 100644
@@ -0,0 +1,27 @@
1+[skipToContent]
2+other = "Saltar al contenido"
3+
4+[about]
5+other = "Acerca de"
6+
7+[minRead]
8+other = "{{ .Count }} min de lectura"
9+
10+[postsCount]
11+one = "{{ .Count }} artículo"
12+other = "{{ .Count }} artículos"
13+
14+[licenseText]
15+other = "Texto bajo licencia"
16+
17+[subscribeRSS]
18+other = "Suscribirse vía RSS"
19+
20+[rssLabel]
21+other = "RSS"
22+
23+[latest]
24+other = "Último"
25+
26+[readMore]
27+other = "Leer →"
modified flake.nix +1 -1
@@ -90,7 +90,7 @@
9090 root="$(git rev-parse --show-toplevel)"
9191 link="$(mktemp -d)/result"
9292 nix build "$root#default" --out-link "$link"
93- for lang in en fr pt ja; do
93+ for lang in en fr pt ja es; do
9494 project="mykiwi-blog-$lang"
9595 echo "==> deploying $lang -> $project"
9696 wrangler pages deploy "$link/$lang" --project-name="$project" --branch=main
@@ -90,7 +90,7 @@
90 root="$(git rev-parse --show-toplevel)"90 root="$(git rev-parse --show-toplevel)"
91 link="$(mktemp -d)/result"91 link="$(mktemp -d)/result"
92 nix build "$root#default" --out-link "$link"92 nix build "$root#default" --out-link "$link"
93- for lang in en fr pt ja; do93+ for lang in en fr pt ja es; do
94 project="mykiwi-blog-$lang"94 project="mykiwi-blog-$lang"
95 echo "==> deploying $lang -> $project"95 echo "==> deploying $lang -> $project"
96 wrangler pages deploy "$link/$lang" --project-name="$project" --branch=main96 wrangler pages deploy "$link/$lang" --project-name="$project" --branch=main
modified infra/README.md +3 -2
@@ -3,8 +3,9 @@
33 OpenTofu config for the Cloudflare side of the multihost setup in
44 `blog/hugo.toml`: one Cloudflare Pages project, custom domain, and DNS
55 record per language (`mykiwi.blog`, `fr.mykiwi.blog`, `pt.mykiwi.blog`,
6-`ja.mykiwi.blog`). It assumes `mykiwi.blog` is already a zone in your
7-Cloudflare account - this only manages what's *inside* that zone.
6+`ja.mykiwi.blog`, `es.mykiwi.blog`). It assumes `mykiwi.blog` is already
7+a zone in your Cloudflare account - this only manages what's *inside*
8+that zone.
89
910 Deploys (`wrangler pages deploy public/<lang> --project-name=...`) are out
1011 of scope here; this just provisions the projects and domains deploys land
@@ -3,8 +3,9 @@
3 OpenTofu config for the Cloudflare side of the multihost setup in3 OpenTofu config for the Cloudflare side of the multihost setup in
4 `blog/hugo.toml`: one Cloudflare Pages project, custom domain, and DNS4 `blog/hugo.toml`: one Cloudflare Pages project, custom domain, and DNS
5 record per language (`mykiwi.blog`, `fr.mykiwi.blog`, `pt.mykiwi.blog`,5 record per language (`mykiwi.blog`, `fr.mykiwi.blog`, `pt.mykiwi.blog`,
6-`ja.mykiwi.blog`). It assumes `mykiwi.blog` is already a zone in your6+`ja.mykiwi.blog`, `es.mykiwi.blog`). It assumes `mykiwi.blog` is already
7-Cloudflare account - this only manages what's *inside* that zone.7+a zone in your Cloudflare account - this only manages what's *inside*
8+that zone.
8 9
9 Deploys (`wrangler pages deploy public/<lang> --project-name=...`) are out10 Deploys (`wrangler pages deploy public/<lang> --project-name=...`) are out
10 of scope here; this just provisions the projects and domains deploys land11 of scope here; this just provisions the projects and domains deploys land
modified infra/main.tf +1 -0
@@ -8,6 +8,7 @@ locals {
88 fr = { hostname = "fr.${var.zone_name}", project_name = "mykiwi-blog-fr" }
99 pt = { hostname = "pt.${var.zone_name}", project_name = "mykiwi-blog-pt" }
1010 ja = { hostname = "ja.${var.zone_name}", project_name = "mykiwi-blog-ja" }
11+ es = { hostname = "es.${var.zone_name}", project_name = "mykiwi-blog-es" }
1112 }
1213 }
1314
@@ -8,6 +8,7 @@ locals {
8 fr = { hostname = "fr.${var.zone_name}", project_name = "mykiwi-blog-fr" }8 fr = { hostname = "fr.${var.zone_name}", project_name = "mykiwi-blog-fr" }
9 pt = { hostname = "pt.${var.zone_name}", project_name = "mykiwi-blog-pt" }9 pt = { hostname = "pt.${var.zone_name}", project_name = "mykiwi-blog-pt" }
10 ja = { hostname = "ja.${var.zone_name}", project_name = "mykiwi-blog-ja" }10 ja = { hostname = "ja.${var.zone_name}", project_name = "mykiwi-blog-ja" }
11+ es = { hostname = "es.${var.zone_name}", project_name = "mykiwi-blog-es" }
11 }12 }
12 }13 }
13 14