109 lines
3.5 KiB
HTML
109 lines
3.5 KiB
HTML
|
{{ if .IsHome -}}
|
||
|
{{ if eq .Site.Params.schemaType "Organization" -}}
|
||
|
<script type="application/ld+json">
|
||
|
{
|
||
|
"@context": "https://schema.org",
|
||
|
"@type": "Organization",
|
||
|
"url": "{{ "/" | relURL }}",
|
||
|
"name": "{{ .Site.Params.title }}",
|
||
|
"logo": "{{ "/" | relURL }}{{ .Site.Params.schemaLogo }}",
|
||
|
"sameAs": [
|
||
|
"{{ .Site.Params.schemaTwitter | safeURL }}",
|
||
|
"{{ .Site.Params.schemaLinkedIn | safeURL }}",
|
||
|
"{{ .Site.Params.schemaGitHub | safeURL }}"
|
||
|
]
|
||
|
}
|
||
|
</script>
|
||
|
{{ end -}}
|
||
|
{{ if eq .Site.Params.schemaType "Person" -}}
|
||
|
<script type="application/ld+json">
|
||
|
{
|
||
|
"@context": "https://schema.org",
|
||
|
"@type": "Person",
|
||
|
"url": "{{ "/" | relURL }}",
|
||
|
"name": "{{ .Site.Params.title }}",
|
||
|
"sameAs": [
|
||
|
"{{ .Site.Params.schemaTwitter | safeURL }}",
|
||
|
"{{ .Site.Params.schemaLinkedIn | safeURL }}",
|
||
|
"{{ .Site.Params.schemaGitHub | safeURL }}"
|
||
|
]
|
||
|
}
|
||
|
</script>
|
||
|
{{ end -}}
|
||
|
{{ if .Site.Params.siteLinksSearchBox -}}
|
||
|
<script type="application/ld+json">
|
||
|
{
|
||
|
"@context": "https://schema.org",
|
||
|
"@type": "WebSite",
|
||
|
"url": "{{ "/" | relURL }}",
|
||
|
"potentialAction": {
|
||
|
"@type": "SearchAction",
|
||
|
"target": "{{ "/" | relURL }}?q={search_term_string}",
|
||
|
"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": "{{ .RelPermalink }}"
|
||
|
},
|
||
|
"headline": "{{ .Title }}",
|
||
|
"image": [{{ range $i, $e := .Params.images }}{{ if $i }}, {{ end }}{{ printf "%s%s" $.RelPermalink $e }}{{ end }}],
|
||
|
"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",
|
||
|
"url": "{{ "/" | relURL }}{{ .Site.Params.schemaLogo }}"
|
||
|
}
|
||
|
{{ end -}}
|
||
|
},
|
||
|
"description": "{{ .Description }}"
|
||
|
}
|
||
|
</script>
|
||
|
{{ end -}}
|
||
|
{{ end -}}
|
||
|
|
||
|
{{ $dot := . -}}
|
||
|
{{ $dot.Scratch.Set "path" "" -}}
|
||
|
{{ $dot.Scratch.Set "breadcrumb" slice -}}
|
||
|
|
||
|
{{ $url := replace .RelPermalink ( printf "%s" .Site.BaseURL) "" -}}
|
||
|
{{ $.Scratch.Add "path" .Site.BaseURL -}}
|
||
|
|
||
|
{{ $.Scratch.Add "breadcrumb" (slice (dict "url" .Site.BaseURL "name" "home" "position" 1 )) -}}
|
||
|
{{ range $index, $element := split $url "/" -}}
|
||
|
{{ $dot.Scratch.Add "path" $element -}}
|
||
|
{{ $.Scratch.Add "path" "/" -}}
|
||
|
{{ if ne $element "" -}}
|
||
|
{{ $.Scratch.Add "breadcrumb" (slice (dict "url" ($.Scratch.Get "path") "name" . "position" (add $index 2))) -}}
|
||
|
{{ end -}}
|
||
|
{{ 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 }},
|
||
|
"name": "{{ .name | humanize | title }}",
|
||
|
"item": "{{ .url }}"
|
||
|
}{{ end }}]
|
||
|
}
|
||
|
</script>
|