diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-22 11:48:19 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-22 11:48:19 +0200 |
| commit | dfa654ef8c1128e0f09dc269e3643d73ac3fa69d (patch) | |
| tree | 1b9bca22df92e260145d4e0ebcc13ebd9081b578 /themes/danix-xyz-hacker/layouts/partials/breadcrumb.html | |
| parent | 3e568636ea564606abddcd05288d06e036a5efe4 (diff) | |
| download | danixxyz-dfa654ef8c1128e0f09dc269e3643d73ac3fa69d.tar.gz danixxyz-dfa654ef8c1128e0f09dc269e3643d73ac3fa69d.zip | |
fix: breadcrumb uses actual page ancestors instead of hardcoded articles path
Static pages under /is/ now show correct breadcrumb trail (eg. Home / About /
Privacy). Articles still show Home / Articles / Title. Both HTML breadcrumb
and JSON-LD structured data updated.
Diffstat (limited to 'themes/danix-xyz-hacker/layouts/partials/breadcrumb.html')
| -rw-r--r-- | themes/danix-xyz-hacker/layouts/partials/breadcrumb.html | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/themes/danix-xyz-hacker/layouts/partials/breadcrumb.html b/themes/danix-xyz-hacker/layouts/partials/breadcrumb.html index aa7c1e8..c15dfeb 100644 --- a/themes/danix-xyz-hacker/layouts/partials/breadcrumb.html +++ b/themes/danix-xyz-hacker/layouts/partials/breadcrumb.html @@ -1,14 +1,16 @@ {{ $homeLink := "/" }} -{{ $articlesLink := "/articles/" }} {{ if eq .Lang "it" }} {{ $homeLink = "/it/" }} - {{ $articlesLink = "/it/articles/" }} {{ end }} <nav class="breadcrumb mb-6" aria-label="Breadcrumb"> <a href="{{ $homeLink }}">{{ i18n "home" }}</a> - <span class="breadcrumb-separator">/</span> - <a href="{{ $articlesLink }}">{{ i18n "articles" }}</a> + {{ range .Ancestors.Reverse }} + {{ if ne .Kind "home" }} + <span class="breadcrumb-separator">/</span> + <a href="{{ .RelPermalink }}">{{ .Title }}</a> + {{ end }} + {{ end }} <span class="breadcrumb-separator">/</span> <span>{{ .Title }}</span> </nav> |
