{{/* Breadcrumbs mit Microdata + JSON-LD
- Zeigt nichts auf der Startseite
- Crumbs: Startseite → (Sektion/Kategorie) → Aktuelle Seite
- Sektionen werden auf DACH-taugliche Labels gemappt
*/}}
{{ if not .IsHome }}
{{/* ------- Hilfsfunktionen/Labels ------- */}}
{{ $section := .Section | default "" }}
{{ $sectionLabel := "" }}
{{ if eq $section "leistungen" }}{{ $sectionLabel = "Leistungen" }}
{{ else if or (eq $section "post") (eq $section "posts") (eq $section "blog") (eq $section "blogs") (eq $section "news") }}{{ $sectionLabel = "Wissen" }}
{{ else if or (eq $section "fokusthemen") (eq $section "themen") }}{{ $sectionLabel = "Fokusthemen" }}
{{ else if eq $section "referenzen" }}{{ $sectionLabel = "Referenzen" }}
{{ else if .CurrentSection }}{{ $sectionLabel = .CurrentSection.Title }}
{{ end }}
{{ $crumbs := slice (dict "name" "Startseite" "url" ("/" | relURL)) }}
{{/* Sektion (falls vorhanden) */}}
{{ if $sectionLabel }}
{{ $secURL := cond .CurrentSection ( .CurrentSection.RelPermalink ) (printf "/%s/" $section | relURL) }}
{{ $crumbs = $crumbs | append (dict "name" $sectionLabel "url" $secURL ) }}
{{ end }}
{{/* Optional: erste Kategorie als weiterer Crumb (außer sie wäre ident mit Sektion) */}}
{{ $cat := index .Params.categories 0 }}
{{ if and $cat (ne (lower $cat) (lower $sectionLabel)) }}
{{ $catPage := site.GetPage (printf "/categories/%s" (urlize $cat)) }}
{{ $catURL := cond $catPage $catPage.RelPermalink (printf "/categories/%s/" (urlize $cat) | relURL) }}
{{ $crumbs = $crumbs | append (dict "name" $cat "url" $catURL ) }}
{{ end }}
{{/* Aktuelle Seite */}}
{{ $crumbs = $crumbs | append (dict "name" .Title "url" .RelPermalink) }}
{{ end }}