diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-16 16:23:50 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-16 16:23:50 +0200 |
| commit | 9108c989209b1a1acb1a05e366d6548c76ea16aa (patch) | |
| tree | c11620f617fdc2cead596cf0239ddbee2985be75 | |
| parent | e265bc210a4ba48bc574441bb02677b34a7d6f1c (diff) | |
| download | danixxyz-9108c989209b1a1acb1a05e366d6548c76ea16aa.tar.gz danixxyz-9108c989209b1a1acb1a05e366d6548c76ea16aa.zip | |
feat: make breadcrumb navigation multilingual with proper links
- Added language-aware breadcrumb links (IT uses /it/ subdir, EN uses root)
- Added 'home' translation key to both i18n files
- Breadcrumb now displays translated labels and correct URLs for each language
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
| -rw-r--r-- | i18n/en.yaml | 1 | ||||
| -rw-r--r-- | i18n/it.yaml | 1 | ||||
| -rw-r--r-- | themes/danix-xyz-hacker/layouts/partials/breadcrumb.html | 11 |
3 files changed, 11 insertions, 2 deletions
diff --git a/i18n/en.yaml b/i18n/en.yaml index 64b0a26..d543e6f 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -1,4 +1,5 @@ # Navigation & UI +home: "Home" articles: "Articles" about: "About" here: "Contact" diff --git a/i18n/it.yaml b/i18n/it.yaml index 19847e3..2f8d8e1 100644 --- a/i18n/it.yaml +++ b/i18n/it.yaml @@ -1,4 +1,5 @@ # Navigation & UI +home: "Home" articles: "Articoli" about: "Chi Sono" here: "Contatti" diff --git a/themes/danix-xyz-hacker/layouts/partials/breadcrumb.html b/themes/danix-xyz-hacker/layouts/partials/breadcrumb.html index cae9344..aa7c1e8 100644 --- a/themes/danix-xyz-hacker/layouts/partials/breadcrumb.html +++ b/themes/danix-xyz-hacker/layouts/partials/breadcrumb.html @@ -1,7 +1,14 @@ +{{ $homeLink := "/" }} +{{ $articlesLink := "/articles/" }} +{{ if eq .Lang "it" }} + {{ $homeLink = "/it/" }} + {{ $articlesLink = "/it/articles/" }} +{{ end }} + <nav class="breadcrumb mb-6" aria-label="Breadcrumb"> - <a href="/">Home</a> + <a href="{{ $homeLink }}">{{ i18n "home" }}</a> <span class="breadcrumb-separator">/</span> - <a href="/articles/">Articles</a> + <a href="{{ $articlesLink }}">{{ i18n "articles" }}</a> <span class="breadcrumb-separator">/</span> <span>{{ .Title }}</span> </nav> |
