2021-08-18 07:06:14 +00:00
|
|
|
{{ if .IsHome -}}
|
|
|
|
<script type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "https://schema.org",
|
|
|
|
"@type": "WebSite",
|
2022-01-17 04:56:08 +00:00
|
|
|
"@id": "{{ (site.GetPage "/").Permalink | safeURL }}",
|
2021-08-18 07:06:14 +00:00
|
|
|
"name": "{{ .Site.Title | safeJS }}",
|
2022-01-17 04:56:08 +00:00
|
|
|
{{ with .Site.Params.description }}"description": "{{ . | safeJS }}",{{ end }}
|
|
|
|
{{ with .Site.LanguageCode }}"inLanguage": "{{ . }}",{{ end }}
|
2021-08-25 23:44:41 +00:00
|
|
|
"url": "{{ (site.GetPage "/").Permalink | safeURL }}",
|
2022-01-17 04:56:08 +00:00
|
|
|
"publisher" : {
|
|
|
|
"@type": "Person",
|
|
|
|
"name": "{{ .Site.Author.name | safeJS }}",
|
|
|
|
},
|
|
|
|
{{ with .Site.Params.keywords }}"keywords": {{ . }},{{ end }}
|
2021-08-18 07:06:14 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{{ else if .IsPage }}
|
|
|
|
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
2022-01-17 04:56:08 +00:00
|
|
|
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
|
|
|
|
{{ $.Scratch.Delete "path" }}
|
|
|
|
{{ $.Scratch.Add "path" .Site.BaseURL }}
|
|
|
|
{{ $count := len (split $url "/") }}
|
2021-08-18 07:06:14 +00:00
|
|
|
<script type="application/ld+json">
|
2022-01-17 04:56:08 +00:00
|
|
|
[{
|
2021-08-18 07:06:14 +00:00
|
|
|
"@context": "https://schema.org",
|
2022-01-17 04:56:08 +00:00
|
|
|
"@type": "Article",
|
|
|
|
"articleSection": "{{ (site.GetPage .Section).Title | safeJS }}",
|
2021-08-18 07:06:14 +00:00
|
|
|
"name": "{{ .Title | safeJS }}",
|
|
|
|
"headline": "{{ .Title | safeJS }}",
|
2022-01-17 04:56:08 +00:00
|
|
|
{{ with .Description }}"description": "{{ . | safeJS }}",{{ end }}
|
|
|
|
{{ with .Summary }}"abstract": "{{ . | safeJS }}",{{ end }}
|
|
|
|
{{ with .Site.LanguageCode }}"inLanguage": "{{ . }}",{{ end }}
|
|
|
|
"url" : "{{ .Permalink }}",
|
2021-08-18 07:06:14 +00:00
|
|
|
"author" : {
|
|
|
|
"@type": "Person",
|
|
|
|
"name": "{{ .Site.Author.name | safeJS }}"
|
|
|
|
},
|
|
|
|
{{ with .PublishDate }}"copyrightYear": "{{ .Format "2006" }}",{{ end }}
|
2022-01-17 04:56:08 +00:00
|
|
|
{{ with .Date }}"dateCreated": "{{ .Format $iso8601 }}",{{ end }}
|
2021-08-18 07:06:14 +00:00
|
|
|
{{ with .PublishDate }}"datePublished": "{{ .Format $iso8601 }}",{{ end }}
|
2022-01-17 04:56:08 +00:00
|
|
|
{{ with .ExpiryDate }}"expires": "{{ .Format $iso8601 }}",{{ end }}
|
2021-08-18 07:06:14 +00:00
|
|
|
{{ with .Lastmod }}"dateModified": "{{ .Format $iso8601 }}",{{ end }}
|
2022-01-17 04:56:08 +00:00
|
|
|
{{ if .Keywords }}
|
|
|
|
{{ with .Keywords }}"keywords": {{ . }},{{ end }}
|
|
|
|
{{ else }}
|
2022-01-07 03:50:15 +00:00
|
|
|
{{ with .Params.tags }}"keywords": {{ . }},{{ end }}
|
2022-01-17 04:56:08 +00:00
|
|
|
{{ end }}
|
|
|
|
"mainEntityOfPage": "true",
|
2022-01-07 03:50:15 +00:00
|
|
|
"wordCount": "{{ .WordCount }}"
|
2022-01-17 04:56:08 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"@context": "http://schema.org",
|
|
|
|
"@type": "BreadcrumbList",
|
|
|
|
"itemListElement":
|
|
|
|
[{
|
|
|
|
"@type": "ListItem",
|
|
|
|
"position": 1,
|
|
|
|
"item": {
|
|
|
|
"@id": "{{ .Site.BaseURL }}",
|
|
|
|
"name": "Home"
|
|
|
|
}
|
|
|
|
},{{ range $index, $element := split $url "/" }}{{ $.Scratch.Add "path" $element }}{{ if ne $element "" }}
|
|
|
|
{
|
|
|
|
"@type": "ListItem",
|
|
|
|
"position": {{ add $index 2 }},
|
|
|
|
"item": {
|
|
|
|
"@id": "{{ $.Scratch.Get "path" }}",
|
|
|
|
"name": "{{ humanize . }}"
|
|
|
|
}
|
|
|
|
}{{ if not (eq $index (sub $count 2)) }}, {{ end }}{{ $.Scratch.Add "path" "/" }}{{ end }}{{ end }}
|
|
|
|
]
|
|
|
|
}]
|
2021-08-18 07:06:14 +00:00
|
|
|
</script>
|
|
|
|
{{ end }}
|