summaryrefslogtreecommitdiffstats
path: root/themes/danix-xyz-hacker/layouts/partials/breadcrumb-jsonld.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/danix-xyz-hacker/layouts/partials/breadcrumb-jsonld.html')
-rw-r--r--themes/danix-xyz-hacker/layouts/partials/breadcrumb-jsonld.html25
1 files changed, 14 insertions, 11 deletions
diff --git a/themes/danix-xyz-hacker/layouts/partials/breadcrumb-jsonld.html b/themes/danix-xyz-hacker/layouts/partials/breadcrumb-jsonld.html
index 3f873a0..95b5e69 100644
--- a/themes/danix-xyz-hacker/layouts/partials/breadcrumb-jsonld.html
+++ b/themes/danix-xyz-hacker/layouts/partials/breadcrumb-jsonld.html
@@ -1,10 +1,7 @@
{{- $homeURL := absURL "/" -}}
-{{- $articlesURL := absURL "/articles/" -}}
{{- $homeName := i18n "home" -}}
-{{- $articlesName := i18n "articles" -}}
{{- if eq .Lang "it" -}}
{{- $homeURL = absURL "/it/" -}}
- {{- $articlesURL = absURL "/it/articles/" -}}
{{- end -}}
<script type="application/ld+json">
{
@@ -16,16 +13,22 @@
"position": 1,
"name": "{{ $homeName }}",
"item": "{{ $homeURL }}"
- },
- {
+ }
+ {{- $pos := 1 -}}
+ {{- range .Ancestors.Reverse -}}
+ {{- if ne .Kind "home" -}}
+ {{- $pos = add $pos 1 -}}
+ ,{
"@type": "ListItem",
- "position": 2,
- "name": "{{ $articlesName }}",
- "item": "{{ $articlesURL }}"
- },
- {
+ "position": {{ $pos }},
+ "name": "{{ .Title }}",
+ "item": "{{ .Permalink }}"
+ }
+ {{- end -}}
+ {{- end -}}
+ ,{
"@type": "ListItem",
- "position": 3,
+ "position": {{ add $pos 1 }},
"name": "{{ .Title }}"
}
]