2020-10-15 00:51:33 -04:00
|
|
|
{{ if .IsHome }}
|
|
|
|
<script type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "https://schema.org",
|
2022-03-27 09:14:06 -04:00
|
|
|
"@type": "{{- ( site.Params.schema.publisherType | default "Organization") | title -}}",
|
|
|
|
"name": {{ site.Title }},
|
|
|
|
"url": {{ site.BaseURL }},
|
|
|
|
"description": {{ site.Params.description | plainify | truncate 180 | safeHTML }},
|
|
|
|
"thumbnailUrl": {{ site.Params.assets.favicon | default "favicon.ico" | absURL }},
|
2020-10-15 00:51:33 -04:00
|
|
|
"sameAs": [
|
2022-03-27 09:14:06 -04:00
|
|
|
{{- if site.Params.schema.sameAs }}
|
|
|
|
{{ range $i, $e := site.Params.schema.sameAs }}{{ if $i }}, {{ end }}{{ trim $e " " }}{{ end }}
|
2020-10-15 00:51:33 -04:00
|
|
|
{{- else}}
|
2022-03-27 09:14:06 -04:00
|
|
|
{{ range $i, $e := site.Params.SocialIcons }}{{ if $i }}, {{ end }}{{ trim $e.url " " }}{{ end }}
|
2020-10-15 00:51:33 -04:00
|
|
|
{{- end}}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
</script>
|
2021-02-12 02:01:00 -05:00
|
|
|
{{- else if (or .IsPage .IsSection) }}
|
|
|
|
{{/* BreadcrumbList */}}
|
2022-03-27 09:14:06 -04:00
|
|
|
{{- $url := replace .Parent.Permalink ( printf "%s" site.BaseURL) "" }}
|
2021-02-22 01:00:04 -05:00
|
|
|
{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
|
2021-02-12 02:01:00 -05:00
|
|
|
{{- $bc_list := (split $lang_url "/")}}
|
|
|
|
|
|
|
|
{{- $scratch := newScratch }}
|
|
|
|
<script type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "https://schema.org",
|
|
|
|
"@type": "BreadcrumbList",
|
|
|
|
"itemListElement": [
|
|
|
|
{{- range $index, $element := $bc_list }}
|
|
|
|
|
|
|
|
{{- $scratch.Add "path" (printf "%s/" $element ) | safeJS }}
|
2022-03-27 09:14:06 -04:00
|
|
|
{{- $bc_pg := site.GetPage ($scratch.Get "path") -}}
|
2021-02-12 02:01:00 -05:00
|
|
|
|
|
|
|
{{- if (and ($bc_pg) (gt (len . ) 0))}}
|
|
|
|
{{- if (and $index)}}, {{end }}
|
|
|
|
{
|
|
|
|
"@type": "ListItem",
|
|
|
|
"position": {{ add 1 $index }},
|
|
|
|
"name": {{ $bc_pg.Name }},
|
|
|
|
"item": {{ $bc_pg.Permalink | safeHTML }}
|
|
|
|
}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- end }}
|
|
|
|
{{- /* self-page addition */ -}}
|
2021-02-16 08:07:30 -05:00
|
|
|
{{- if (ge (len $bc_list) 2) }}, {{end }}
|
2021-02-12 02:01:00 -05:00
|
|
|
{
|
|
|
|
"@type": "ListItem",
|
|
|
|
"position": {{len $bc_list}},
|
|
|
|
"name": {{ .Name }},
|
|
|
|
"item": {{ .Permalink | safeHTML }}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{{- if .IsPage }}
|
2020-10-15 00:51:33 -04:00
|
|
|
<script type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "https://schema.org",
|
|
|
|
"@type": "BlogPosting",
|
|
|
|
"headline": {{ .Title | plainify}},
|
|
|
|
"name": "{{ .Title | plainify }}",
|
2021-03-23 05:40:40 -04:00
|
|
|
"description": {{ with .Description | plainify }}{{ . }}{{ else }}{{ .Summary | plainify }}{{ end -}},
|
2020-10-15 00:51:33 -04:00
|
|
|
"keywords": [
|
|
|
|
{{- if .Params.keywords }}
|
|
|
|
{{ range $i, $e := .Params.keywords }}{{ if $i }}, {{ end }}{{ $e }}{{ end }}
|
|
|
|
{{- else }}
|
|
|
|
{{ range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }}
|
|
|
|
{{- end }}
|
|
|
|
],
|
|
|
|
"articleBody": {{ .Content | safeJS | htmlUnescape | plainify }},
|
|
|
|
"wordCount" : "{{ .WordCount }}",
|
|
|
|
"inLanguage": {{ .Language.Lang | default "en-us" }},
|
|
|
|
{{ if .Params.cover.image -}}
|
|
|
|
"image":
|
|
|
|
{{- if (ne .Params.cover.relative true) -}}
|
|
|
|
{{ .Params.cover.image | absURL }},
|
|
|
|
{{- else -}}
|
|
|
|
{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }},
|
|
|
|
{{- end}}
|
2020-10-25 03:19:58 -04:00
|
|
|
{{- end -}}
|
2020-10-15 00:51:33 -04:00
|
|
|
"datePublished": {{ .PublishDate }},
|
|
|
|
"dateModified": {{ .Lastmod }},
|
2022-03-27 09:14:06 -04:00
|
|
|
{{- with (.Params.author | default site.Params.author) }}
|
2020-10-25 03:19:58 -04:00
|
|
|
"author":
|
2020-10-25 03:38:03 -04:00
|
|
|
{{- if (or (eq (printf "%T" .) "[]string") (eq (printf "%T" .) "[]interface {}")) -}}
|
2020-10-25 03:19:58 -04:00
|
|
|
[{{- range $i, $v := . -}}
|
|
|
|
{{- if $i }}, {{end -}}
|
|
|
|
{
|
2020-10-15 00:51:33 -04:00
|
|
|
"@type": "Person",
|
2020-10-25 03:19:58 -04:00
|
|
|
"name": {{ $v }}
|
|
|
|
}
|
|
|
|
{{- end }}],
|
|
|
|
{{- else -}}
|
|
|
|
{
|
|
|
|
"@type": "Person",
|
|
|
|
"name": {{ . }}
|
2020-10-15 00:51:33 -04:00
|
|
|
},
|
2020-10-25 03:19:58 -04:00
|
|
|
{{- end -}}
|
|
|
|
{{- end }}
|
2020-10-15 00:51:33 -04:00
|
|
|
"mainEntityOfPage": {
|
|
|
|
"@type": "WebPage",
|
|
|
|
"@id": {{ .Permalink | safeHTML }}
|
|
|
|
},
|
|
|
|
"publisher": {
|
2022-03-27 09:14:06 -04:00
|
|
|
"@type": "{{- ( site.Params.schema.publisherType | default "Organization") | title -}}",
|
|
|
|
"name": {{ site.Title }},
|
2020-10-15 00:51:33 -04:00
|
|
|
"logo": {
|
|
|
|
"@type": "ImageObject",
|
2022-03-27 09:14:06 -04:00
|
|
|
"url": {{ site.Params.assets.favicon | default "favicon.ico" | absURL }}
|
2020-10-15 00:51:33 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
2021-03-30 08:37:36 -04:00
|
|
|
{{- end }}{{/* .IsPage end */}}
|
2021-02-12 02:01:00 -05:00
|
|
|
|
2021-03-30 08:37:36 -04:00
|
|
|
{{- end -}}
|