summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--themes/danix-xyz-hacker/layouts/partials/breadcrumb-jsonld.html33
-rw-r--r--themes/danix-xyz-hacker/layouts/partials/head-meta.html3
2 files changed, 36 insertions, 0 deletions
diff --git a/themes/danix-xyz-hacker/layouts/partials/breadcrumb-jsonld.html b/themes/danix-xyz-hacker/layouts/partials/breadcrumb-jsonld.html
new file mode 100644
index 0000000..3f873a0
--- /dev/null
+++ b/themes/danix-xyz-hacker/layouts/partials/breadcrumb-jsonld.html
@@ -0,0 +1,33 @@
+{{- $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">
+{
+ "@context": "https://schema.org",
+ "@type": "BreadcrumbList",
+ "itemListElement": [
+ {
+ "@type": "ListItem",
+ "position": 1,
+ "name": "{{ $homeName }}",
+ "item": "{{ $homeURL }}"
+ },
+ {
+ "@type": "ListItem",
+ "position": 2,
+ "name": "{{ $articlesName }}",
+ "item": "{{ $articlesURL }}"
+ },
+ {
+ "@type": "ListItem",
+ "position": 3,
+ "name": "{{ .Title }}"
+ }
+ ]
+}
+</script>
diff --git a/themes/danix-xyz-hacker/layouts/partials/head-meta.html b/themes/danix-xyz-hacker/layouts/partials/head-meta.html
index 45fd476..89b5d50 100644
--- a/themes/danix-xyz-hacker/layouts/partials/head-meta.html
+++ b/themes/danix-xyz-hacker/layouts/partials/head-meta.html
@@ -52,3 +52,6 @@
<link rel="alternate" hreflang="x-default" href="{{ .Permalink }}">
{{ end }}
{{ end }}
+
+{{/* Structured data: BreadcrumbList JSON-LD (single content pages only) */}}
+{{ if eq .Kind "page" }}{{ partial "breadcrumb-jsonld.html" . }}{{ end }}