From 58718ebaeca4d9efb5cac54dda6f234615d2dd2c Mon Sep 17 00:00:00 2001 From: George Cushen Date: Thu, 18 Dec 2025 23:03:51 +0000 Subject: [PATCH] fix: BreadcrumbList structured data to comply with Google Search Console requirements Add missing @type "ListItem" to breadcrumb items and restructure item field from URL string to object with @id and name properties. Resolves "Invalid object type for field 'itemListElement'" errors reported in Google Search Console. See https://discord.com/channels/722225264733716590/1451194469637427272 --- .../layouts/_partials/jsonld/breadcrumbs.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/blox-tailwind/layouts/_partials/jsonld/breadcrumbs.html b/modules/blox-tailwind/layouts/_partials/jsonld/breadcrumbs.html index b269eee7..20cfb39a 100644 --- a/modules/blox-tailwind/layouts/_partials/jsonld/breadcrumbs.html +++ b/modules/blox-tailwind/layouts/_partials/jsonld/breadcrumbs.html @@ -6,20 +6,23 @@ {{- with site.Home -}} {{- $home_title := .LinkTitle | default site.Title | default "Home" -}} - {{- $items = $items | append (dict "position" $position "name" ($home_title | plainify) "item" .Permalink) -}} + {{- $item := dict "@type" "ListItem" "position" $position "name" ($home_title | plainify) "item" (dict "@id" .Permalink "name" ($home_title | plainify)) -}} + {{- $items = $items | append $item -}} {{- $position = add $position 1 -}} {{- end -}} {{- with $page.Ancestors -}} {{- range .Reverse -}} {{- if not .IsHome -}} - {{- $items = $items | append (dict "position" $position "name" (.LinkTitle | plainify) "item" .Permalink) -}} + {{- $item := dict "@type" "ListItem" "position" $position "name" (.LinkTitle | plainify) "item" (dict "@id" .Permalink "name" (.LinkTitle | plainify)) -}} + {{- $items = $items | append $item -}} {{- $position = add $position 1 -}} {{- end -}} {{- end -}} {{- end -}} - {{- $items = $items | append (dict "position" $position "name" ($page.LinkTitle | default $page.Title | plainify) "item" $page.Permalink) -}} + {{- $item := dict "@type" "ListItem" "position" $position "name" ($page.LinkTitle | default $page.Title | plainify) "item" (dict "@id" $page.Permalink "name" ($page.LinkTitle | default $page.Title | plainify)) -}} + {{- $items = $items | append $item -}} {{- if gt (len $items) 1 -}} {{- $breadcrumb := dict "@context" "https://schema.org" "@type" "BreadcrumbList" "itemListElement" $items -}}