2020-10-15 00:51:33 -04:00
|
|
|
{{ if .IsHome }}
|
|
|
|
<script type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "https://schema.org",
|
|
|
|
"@type": "{{- ( .Site.Params.schema.publisherType | default "Organization") | humanize -}}",
|
|
|
|
"name": {{ .Site.Title }},
|
|
|
|
"url": {{ .Site.BaseURL }},
|
|
|
|
"description": {{ .Site.Params.description | plainify | truncate 180 | safeHTML }},
|
|
|
|
"thumbnailUrl": {{ .Site.Params.assets.favicon | default "favicon.ico" | absURL }},
|
|
|
|
"sameAs": [
|
|
|
|
{{- if .Site.Params.schema.sameAs }}
|
2020-12-13 06:26:41 -05:00
|
|
|
{{ range $i, $e := .Site.Params.schema.sameAs }}{{ if $i }}, {{ end }}{{ trim $e " " }}{{ end }}
|
2020-10-15 00:51:33 -04:00
|
|
|
{{- else}}
|
2020-12-13 06:26:41 -05: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 */}}
|
|
|
|
{{- $url := replace .Parent.Permalink ( printf "%s" .Site.BaseURL) "" }}
|
|
|
|
{{- $lang_url := replace $url ( printf "%s" .Lang) "" }}
|
|
|
|
{{- $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 }}
|
|
|
|
{{- $bc_pg := $.Site.GetPage ($scratch.Get "path") -}}
|
|
|
|
|
|
|
|
{{- 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 */ -}}
|
|
|
|
{{- if $bc_list }}, {{end }}
|
|
|
|
{
|
|
|
|
"@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 }}",
|
|
|
|
"description": {{ .Summary | plainify | truncate 180 | safeHTML }},
|
|
|
|
"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 }},
|
2020-10-25 03:19:58 -04:00
|
|
|
{{- with (.Params.author | default .Site.Params.author) }}
|
|
|
|
"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": {
|
|
|
|
"@type": "{{- ( .Site.Params.schema.publisherType | default "Organization") | humanize -}}",
|
|
|
|
"name": {{ .Site.Title }},
|
|
|
|
"logo": {
|
|
|
|
"@type": "ImageObject",
|
|
|
|
"url": {{ .Site.Params.assets.favicon | default "favicon.ico" | absURL }}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
2021-02-12 02:01:00 -05:00
|
|
|
{{ end }}{{/* .IsPage end */}}
|
|
|
|
|
2020-10-15 00:51:33 -04:00
|
|
|
{{ end }}
|