{{- /* Override of PaperMod's templates/schema_json.html. PaperMod's BreadcrumbList builds the trail by string-manipulating permalinks: `replace .Parent.Permalink site.Home.Permalink "" | split "/"`. With --baseURL "/" (CI preview mode) that yields a 1-element list instead of 2, which breaks the comma logic (`ge (len $bc_list) 2`) and the position counter — producing `} {` with no comma and two items both at position 1. Hugo's --minify catches this as a JSON parse error. This override uses `.Ancestors.Reverse` (stable regardless of baseURL) and dict+jsonify (escapes correctly, no hand-assembled JSON). The homepage and BlogPosting blocks are carried over unchanged. */ -}} {{ if .IsHome }} {{- else if (or .IsPage .IsSection) }} {{- $crumbs := slice -}} {{- $pos := 0 -}} {{- range .Ancestors.Reverse -}} {{- $pos = add $pos 1 -}} {{- $crumbs = $crumbs | append (dict "@type" "ListItem" "position" $pos "name" .Title "item" .Permalink) -}} {{- end -}} {{- $pos = add $pos 1 -}} {{- $crumbs = $crumbs | append (dict "@type" "ListItem" "position" $pos "name" .Title "item" .Permalink) -}} {{- $breadcrumb := dict "@context" "https://schema.org" "@type" "BreadcrumbList" "itemListElement" $crumbs -}} {{- if .IsPage }} {{- end }}{{/* .IsPage end */}} {{- end -}}