Skip to content

Commit faa7c11

Browse files
johanrinclaude
andcommitted
Add breadcrumb schema for better search results
Implements BreadcrumbList JSON-LD structured data: - Posts list: Home > Posts - Single post: Home > Posts > Post Title Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a27abb4 commit faa7c11

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

layouts/partials/meta/post.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
<meta property="article:section" content="{{ index . 0 }}" />
3636
{{ end }}
3737

38+
{{/* Article structured data - only for single posts */}}
39+
{{ if eq .Page.Kind "page" }}
3840
<script defer type="application/ld+json">
3941
{
4042
"@context": "https://schema.org",
@@ -61,4 +63,35 @@
6163
}
6264
}
6365
</script>
66+
{{ end }}
67+
68+
{{/* Breadcrumb structured data */}}
69+
<script defer type="application/ld+json">
70+
{
71+
"@context": "https://schema.org",
72+
"@type": "BreadcrumbList",
73+
"itemListElement": [
74+
{
75+
"@type": "ListItem",
76+
"position": 1,
77+
"name": "Home",
78+
"item": "{{ .Site.BaseURL }}"
79+
},
80+
{
81+
"@type": "ListItem",
82+
"position": 2,
83+
"name": "Posts",
84+
"item": "{{ .Site.BaseURL }}posts/"
85+
}
86+
{{- if eq .Page.Kind "page" -}}
87+
,{
88+
"@type": "ListItem",
89+
"position": 3,
90+
"name": {{ .Title }},
91+
"item": "{{ .Permalink }}"
92+
}
93+
{{- end -}}
94+
]
95+
}
96+
</script>
6497
{{ end }}

0 commit comments

Comments
 (0)