diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-22 12:42:56 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-22 12:42:56 +0200 |
| commit | 631547a75142326a7c71bdf123e1475217a5ad73 (patch) | |
| tree | f3cfef6b3c5b42bf626fc823ddcf63b8dcf4cdbb /layouts/partials/breadcrumb-jsonld.html | |
| parent | 77ccbe72fad5a4870185fff374f75471c16a9043 (diff) | |
| download | danixxyz-theme-631547a75142326a7c71bdf123e1475217a5ad73.tar.gz danixxyz-theme-631547a75142326a7c71bdf123e1475217a5ad73.zip | |
chore: replace with extracted danix.xyz-hacker theme (danix2-hugo-theme)
Diffstat (limited to 'layouts/partials/breadcrumb-jsonld.html')
| -rw-r--r-- | layouts/partials/breadcrumb-jsonld.html | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/layouts/partials/breadcrumb-jsonld.html b/layouts/partials/breadcrumb-jsonld.html new file mode 100644 index 0000000..95b5e69 --- /dev/null +++ b/layouts/partials/breadcrumb-jsonld.html @@ -0,0 +1,36 @@ +{{- $homeURL := absURL "/" -}} +{{- $homeName := i18n "home" -}} +{{- if eq .Lang "it" -}} + {{- $homeURL = absURL "/it/" -}} +{{- end -}} +<script type="application/ld+json"> +{ + "@context": "https://schema.org", + "@type": "BreadcrumbList", + "itemListElement": [ + { + "@type": "ListItem", + "position": 1, + "name": "{{ $homeName }}", + "item": "{{ $homeURL }}" + } + {{- $pos := 1 -}} + {{- range .Ancestors.Reverse -}} + {{- if ne .Kind "home" -}} + {{- $pos = add $pos 1 -}} + ,{ + "@type": "ListItem", + "position": {{ $pos }}, + "name": "{{ .Title }}", + "item": "{{ .Permalink }}" + } + {{- end -}} + {{- end -}} + ,{ + "@type": "ListItem", + "position": {{ add $pos 1 }}, + "name": "{{ .Title }}" + } + ] +} +</script> |
