2020-04-15 15:48:16 +02:00
|
|
|
{{ if .IsHome -}}
|
|
|
|
{{ if eq .Site.Params.schemaType "Organization" -}}
|
|
|
|
<script type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "https://schema.org",
|
|
|
|
"@type": "Organization",
|
2020-11-04 08:26:58 +01:00
|
|
|
"url": "{{ "/" | absURL }}",
|
2020-04-15 15:48:16 +02:00
|
|
|
"name": "{{ .Site.Params.title }}",
|
2020-11-04 08:26:58 +01:00
|
|
|
"logo": "{{ "/" | absURL }}{{ .Site.Params.schemaLogo }}",
|
2020-04-15 15:48:16 +02:00
|
|
|
"sameAs": [
|
|
|
|
"{{ .Site.Params.schemaTwitter | safeURL }}",
|
2020-11-04 08:26:58 +01:00
|
|
|
"{{ .Site.Params.schemaLinkedIn | safeURL }}",
|
|
|
|
"{{ .Site.Params.schemaGitHub | safeURL }}"
|
2020-04-15 15:48:16 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{{ end -}}
|
|
|
|
{{ if eq .Site.Params.schemaType "Person" -}}
|
|
|
|
<script type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "https://schema.org",
|
|
|
|
"@type": "Person",
|
2020-11-04 08:26:58 +01:00
|
|
|
"url": "{{ "/" | absURL }}",
|
2020-04-15 15:48:16 +02:00
|
|
|
"name": "{{ .Site.Params.title }}",
|
|
|
|
"sameAs": [
|
|
|
|
"{{ .Site.Params.schemaTwitter | safeURL }}",
|
2020-11-04 08:26:58 +01:00
|
|
|
"{{ .Site.Params.schemaLinkedIn | safeURL }}",
|
|
|
|
"{{ .Site.Params.schemaGitHub | safeURL }}"
|
2020-04-15 15:48:16 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{{ end -}}
|
|
|
|
{{ if .Site.Params.siteLinksSearchBox -}}
|
|
|
|
<script type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "https://schema.org",
|
|
|
|
"@type": "WebSite",
|
2020-11-04 08:26:58 +01:00
|
|
|
"url": "{{ "/" | absURL }}",
|
2020-04-15 15:48:16 +02:00
|
|
|
"potentialAction": {
|
|
|
|
"@type": "SearchAction",
|
2020-11-04 08:26:58 +01:00
|
|
|
"target": "{{ "/" | absURL }}?q={search_term_string}",
|
2020-04-15 15:48:16 +02:00
|
|
|
"query-input": "required name=search_term_string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{{ end -}}
|
|
|
|
{{ end -}}
|
|
|
|
{{ if .IsPage -}}
|
|
|
|
{{ if eq .Section .Site.Params.schemaSection -}}
|
|
|
|
<script type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "https://schema.org",
|
|
|
|
"@type": "Article",
|
|
|
|
"mainEntityOfPage": {
|
|
|
|
"@type": "WebPage",
|
|
|
|
"@id": "{{ .Permalink }}"
|
|
|
|
},
|
|
|
|
"headline": "{{ .Title }}",
|
2020-11-04 08:26:58 +01:00
|
|
|
"image": [{{ range $i, $e := .Params.images }}{{ if $i }}, {{ end }}{{ printf "%s%s" $.Permalink $e }}{{ end }}],
|
2020-04-15 15:48:16 +02:00
|
|
|
"datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05CET" }}",
|
|
|
|
"dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05CET" }}",
|
|
|
|
"author": {
|
|
|
|
"@type": "{{ .Site.Params.schemaType }}",
|
|
|
|
"name": "{{ .Site.Params.title }}"
|
|
|
|
},
|
|
|
|
"publisher": {
|
|
|
|
"@type": "{{ .Site.Params.schemaType }}",
|
|
|
|
"name": "{{ .Site.Params.title }}",
|
|
|
|
{{ if eq .Site.Params.schemaType "Organization" -}}
|
|
|
|
"logo": {
|
|
|
|
"@type": "ImageObject",
|
2020-11-04 08:26:58 +01:00
|
|
|
"url": "{{ "/" | absURL }}{{ .Site.Params.schemaLogo }}"
|
2020-04-15 15:48:16 +02:00
|
|
|
}
|
|
|
|
{{ end -}}
|
|
|
|
},
|
|
|
|
"description": "{{ .Description }}"
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{{ end -}}
|
|
|
|
{{ end -}}
|
|
|
|
|
2020-11-04 08:26:58 +01:00
|
|
|
{{ $dot := . -}}
|
|
|
|
{{ $dot.Scratch.Set "path" "" -}}
|
|
|
|
{{ $dot.Scratch.Set "breadcrumb" slice -}}
|
|
|
|
|
2020-04-15 15:48:16 +02:00
|
|
|
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" -}}
|
|
|
|
{{ $.Scratch.Add "path" .Site.BaseURL -}}
|
|
|
|
|
|
|
|
{{ $.Scratch.Add "breadcrumb" (slice (dict "url" .Site.BaseURL "name" "home" "position" 1 )) -}}
|
2020-11-04 08:26:58 +01:00
|
|
|
{{ range $index, $element := split $url "/" -}}
|
|
|
|
{{ $dot.Scratch.Add "path" $element -}}
|
|
|
|
{{ $.Scratch.Add "path" "/" -}}
|
2020-04-15 15:48:16 +02:00
|
|
|
{{ if ne $element "" -}}
|
2020-11-04 08:26:58 +01:00
|
|
|
{{ $.Scratch.Add "breadcrumb" (slice (dict "url" ($.Scratch.Get "path") "name" . "position" (add $index 2))) -}}
|
|
|
|
{{ end -}}
|
2020-04-15 15:48:16 +02:00
|
|
|
{{ end -}}
|
|
|
|
|
|
|
|
<script type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "http://schema.org",
|
|
|
|
"@type": "BreadcrumbList",
|
|
|
|
"itemListElement": [{{ range $.Scratch.Get "breadcrumb" }}{{ if ne .position 1 }},{{ end }}{
|
|
|
|
"@type": "ListItem",
|
|
|
|
"position": {{ .position }},
|
2020-11-04 08:26:58 +01:00
|
|
|
"name": "{{ .name | humanize | title }}",
|
|
|
|
"item": "{{ .url }}"
|
2020-04-15 15:48:16 +02:00
|
|
|
}{{ end }}]
|
|
|
|
}
|
2020-11-04 08:26:58 +01:00
|
|
|
</script>
|