2021-06-25 16:04:42 +02:00
|
|
|
{{ $baseURL := "/" | absURL -}}
|
2020-04-15 15:48:16 +02:00
|
|
|
|
2020-11-04 08:26:58 +01:00
|
|
|
{{ $dot := . -}}
|
|
|
|
{{ $dot.Scratch.Set "path" "" -}}
|
|
|
|
{{ $dot.Scratch.Set "breadcrumb" slice -}}
|
|
|
|
|
2021-06-25 16:04:42 +02:00
|
|
|
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" -}}
|
2020-04-15 15:48:16 +02:00
|
|
|
{{ $.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">
|
|
|
|
{
|
2021-06-25 16:04:42 +02:00
|
|
|
"@context": "https://schema.org",
|
|
|
|
"@graph": [
|
|
|
|
{
|
|
|
|
{{ if eq .Site.Params.schemaType "Organization" -}}
|
|
|
|
"@type": "Organization",
|
|
|
|
"@id": {{ print $baseURL "#/schema/organization/1" }},
|
|
|
|
{{ else -}}
|
|
|
|
"@type": "Person",
|
|
|
|
"@id": {{ print $baseURL "#/schema/person/1" }},
|
|
|
|
{{ end -}}
|
|
|
|
"name": "{{ .Site.Params.schemaName }}",
|
|
|
|
"url": {{ print $baseURL }},
|
|
|
|
"sameAs": [
|
|
|
|
{{ with .Site.Params.schemaTwitter -}}
|
|
|
|
{{ . }}
|
|
|
|
{{ end -}}
|
|
|
|
{{ with .Site.Params.schemaLinkedIn -}}
|
|
|
|
, {{ . }}
|
|
|
|
{{ end -}}
|
|
|
|
{{ with .Site.Params.schemaGitHub -}}
|
|
|
|
, {{ . }}
|
|
|
|
{{ end -}}
|
|
|
|
],
|
|
|
|
{{ if eq .Site.Params.schemaType "Organization" -}}
|
|
|
|
"logo": {
|
|
|
|
"@type": "ImageObject",
|
|
|
|
"@id": {{ print $baseURL "#/schema/image/1"}},
|
|
|
|
"url": {{ print $baseURL .Site.Params.schemaLogo }},
|
|
|
|
"width": {{ .Site.Params.schemaLogoWidth }},
|
|
|
|
"height": {{ .Site.Params.schemaLogoHeight }},
|
|
|
|
"caption": "{{ .Site.Params.schemaName }}"
|
|
|
|
},
|
|
|
|
"image": {
|
|
|
|
"@id": {{ print $baseURL "#/schema/image/1" }}
|
|
|
|
}
|
|
|
|
{{ else -}}
|
|
|
|
"image": {
|
|
|
|
"@type": "ImageObject",
|
|
|
|
"@id": {{ print $baseURL "#/schema/image/1"}},
|
|
|
|
"url": {{ print $baseURL .Site.Params.schemaImage }},
|
|
|
|
"width": {{ .Site.Params.schemaImageWidth }},
|
|
|
|
"height": {{ .Site.Params.schemaImageHeight }},
|
|
|
|
"caption": "{{ .Site.Params.schemaName }}"
|
|
|
|
}
|
|
|
|
{{ end -}}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"@type": "WebSite",
|
|
|
|
"@id": {{ print $baseURL "#/schema/website/1" }},
|
|
|
|
"url": {{ print $baseURL }},
|
|
|
|
"name": "{{ .Site.Params.title }}",
|
|
|
|
"description": "{{ .Site.Params.description }}",
|
|
|
|
{{ if eq .Site.Params.schemaType "Organization" -}}
|
|
|
|
"publisher": {
|
|
|
|
"@id": {{ print $baseURL "#/schema/organization/1" }}
|
|
|
|
}
|
|
|
|
{{ else -}}
|
|
|
|
"publisher": {
|
|
|
|
"@id": {{ print $baseURL "#/schema/person/1" }}
|
|
|
|
}
|
|
|
|
{{ end -}}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{{ if and (ne .Kind "taxonomy") (ne .Kind "term") -}}
|
|
|
|
"@type": "WebPage",
|
|
|
|
{{ else -}}
|
|
|
|
"@type": "CollectionPage",
|
|
|
|
{{ end -}}
|
|
|
|
"@id": {{ .Permalink }},
|
|
|
|
"url": {{ .Permalink }},
|
|
|
|
"name": "{{ .Title }}",
|
|
|
|
"description": "{{ .Description }}",
|
|
|
|
"isPartOf": {
|
|
|
|
"@id": {{ print $baseURL "#/schema/website/1" }}
|
|
|
|
},
|
|
|
|
{{ if eq .Site.Params.schemaType "Organization" -}}
|
|
|
|
"about": {
|
|
|
|
"@id": {{ print $baseURL "#/schema/organization/1" }}
|
|
|
|
},
|
|
|
|
{{ else -}}
|
|
|
|
"about": {
|
|
|
|
"@id": {{ print $baseURL "#/schema/person/1" }}
|
|
|
|
},
|
|
|
|
{{ end -}}
|
|
|
|
"datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05CET" }}",
|
|
|
|
"dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05CET" }}",
|
|
|
|
"breadcrumb": {
|
|
|
|
"@id": {{ print .Permalink "#/schema/breadcrumb/1" }}
|
|
|
|
},
|
|
|
|
"primaryImageOfPage": {
|
|
|
|
"@id": {{ print .Permalink "#/schema/image/2" }}
|
|
|
|
},
|
|
|
|
"inLanguage": "{{ .Site.Params.schemaLocale }}",
|
|
|
|
"potentialAction": [{
|
|
|
|
"@type": "ReadAction", "target": [{{ .Permalink }}]
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"@type": "BreadcrumbList",
|
|
|
|
"@id": {{ print .Permalink "#/schema/breadcrumb/1" }},
|
|
|
|
"name": "Breadcrumbs",
|
|
|
|
"itemListElement": [{{ $list := $.Scratch.Get "breadcrumb" }}{{ $len := (len $list) }}{{ range $index, $element := $list }}{{ if ne .position 1 }},{{ end }}{
|
2020-04-15 15:48:16 +02:00
|
|
|
"@type": "ListItem",
|
|
|
|
"position": {{ .position }},
|
2021-06-25 16:04:42 +02:00
|
|
|
"item": {
|
|
|
|
{{ if ne (add $index 1) $len -}}
|
|
|
|
"@type": "WebPage",
|
|
|
|
"@id": {{ .url }},
|
|
|
|
"url": {{ .url }},
|
|
|
|
"name": "{{ .name | humanize | title }}"
|
|
|
|
{{ else -}}
|
|
|
|
"@id": {{ .url }}
|
|
|
|
{{ end -}}
|
|
|
|
}
|
|
|
|
}{{ end }}]
|
|
|
|
},
|
|
|
|
|
|
|
|
{{ if and (eq .Kind "page") (or (eq .Section "blog") (eq .Section "docs") (eq .Section "tutorial") (eq .Section "showcase")) -}}
|
|
|
|
{
|
|
|
|
"@context": "https://schema.org",
|
|
|
|
"@graph": [
|
|
|
|
{
|
|
|
|
"@type": "Article",
|
|
|
|
"@id": {{ print $baseURL "#/schema/article/1" }},
|
|
|
|
"headline": "{{ .Title }}",
|
|
|
|
"description": "{{ .Description }}",
|
|
|
|
"isPartOf": {
|
|
|
|
"@id": {{ .Permalink }}
|
|
|
|
},
|
|
|
|
"mainEntityOfPage": {
|
|
|
|
"@id": {{ .Permalink }}
|
|
|
|
},
|
|
|
|
"datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05CET" }}",
|
|
|
|
"dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05CET" }}",
|
|
|
|
"author": {
|
|
|
|
"@id": {{ print $baseURL "#/schema/person/2" }}
|
|
|
|
},
|
|
|
|
{{ if eq .Site.Params.schemaType "Organization" -}}
|
|
|
|
"publisher": {
|
|
|
|
"@id": {{ print $baseURL "#/schema/organization/1" }}
|
|
|
|
},
|
|
|
|
{{ else -}}
|
|
|
|
"publisher": {
|
|
|
|
"@id": {{ print $baseURL "#/schema/person/1" }}
|
|
|
|
},
|
|
|
|
{{ end -}}
|
|
|
|
"image": {
|
|
|
|
"@id": {{ print .Permalink "#/schema/image/2" }}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"@context": "https://schema.org",
|
|
|
|
"@graph": [
|
|
|
|
{
|
|
|
|
"@type": "Person",
|
|
|
|
"@id": {{ print $baseURL "#/schema/person/2" }},
|
|
|
|
"name": {{ .Site.Params.schemaAuthor }},
|
|
|
|
"sameAs": [
|
|
|
|
{{ with .Site.Params.schemaAuthorTwitter -}}
|
|
|
|
{{ . }}
|
|
|
|
{{ end -}}
|
|
|
|
{{ with .Site.Params.schemaAuthorLinkedIn -}}
|
|
|
|
, {{ . }}
|
|
|
|
{{ end -}}
|
|
|
|
{{ with .Site.Params.schemaAuthorGitHub -}}
|
|
|
|
, {{ . }}
|
|
|
|
{{ end -}}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{{ end -}}
|
|
|
|
{
|
|
|
|
"@context": "https://schema.org",
|
|
|
|
"@graph": [
|
|
|
|
{
|
|
|
|
"@type": "ImageObject",
|
|
|
|
"@id": {{ print .Permalink "#/schema/image/2" }},
|
|
|
|
"url": {{ $.Scratch.Get "primaryImage" }},
|
|
|
|
"contentUrl": {{ $.Scratch.Get "primaryImage" }},
|
|
|
|
"caption": "{{ .Title }}"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
2020-04-15 15:48:16 +02:00
|
|
|
}
|
2020-11-04 08:26:58 +01:00
|
|
|
</script>
|