{{- $homeURL := absURL "/" -}}
{{- $homeName := i18n "home" -}}
{{- if eq .Lang "it" -}}
  {{- $homeURL = absURL "/it/" -}}
{{- end -}}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "{{ $homeName }}",
      "item": "{{ $homeURL }}"
    }
    {{- $pos := 1 -}}
    {{- range .Ancestors.Reverse -}}
      {{- if ne .Kind "home" -}}
        {{- $pos = add $pos 1 -}}
    ,{
      "@type": "ListItem",
      "position": {{ $pos }},
      "name": "{{ .Title }}",
      "item": "{{ .Permalink }}"
    }
      {{- end -}}
    {{- end -}}
    ,{
      "@type": "ListItem",
      "position": {{ add $pos 1 }},
      "name": "{{ .Title }}"
    }
  ]
}
</script>
