mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 20:15:25 +00:00
BREAKING CHANGE Module paths moved to `github.com/HugoBlox/kit` with new names: - core `blox-tailwind` → `blox` - analytics → `analytics` - netlify → `integrations/netlify` - slides (reveal) → `slides` Update go.mod, module.yaml/params, scripts, tests, and v0.11 migration guide accordingly.
34 lines
1.4 KiB
HTML
34 lines
1.4 KiB
HTML
{{- $page := .page -}}
|
|
|
|
{{- if not $page.IsHome -}}
|
|
{{- $items := slice -}}
|
|
{{- $position := 1 -}}
|
|
|
|
{{- with site.Home -}}
|
|
{{- $home_title := .LinkTitle | default site.Title | default "Home" -}}
|
|
{{- $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 -}}
|
|
{{- $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 -}}
|
|
|
|
{{- $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 -}}
|
|
<script type="application/ld+json">
|
|
{{ $breadcrumb | jsonify (dict "indent" " ") | safeJS }}
|
|
</script>
|
|
{{- end -}}
|
|
{{- end -}}
|