2022-02-06 15:59:16 +00:00
|
|
|
{{- if eq .Kind "home" }}
|
2022-02-05 19:02:17 +00:00
|
|
|
<script type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "http://schema.org",
|
|
|
|
"@type": "WebSite",
|
|
|
|
{{ with .Site.Params.GeekblogAuthor -}}
|
|
|
|
{{ with index $.Site.Data.authors . }}"author": "{{ .name }}",{{ end }}
|
|
|
|
{{- end }}
|
|
|
|
"name": "{{ .Site.Title }}",
|
2022-02-14 15:25:11 +00:00
|
|
|
"url": {{ .Site.BaseURL | jsonify | safeJS }},
|
2022-02-05 19:02:17 +00:00
|
|
|
{{- with partial "utils/description" . }}
|
2022-02-14 15:25:11 +00:00
|
|
|
"description": {{ trim (. | plainify) "\n" | jsonify | safeJS }},
|
|
|
|
{{- end }}
|
|
|
|
{{- with partial "utils/featured" . }}
|
|
|
|
"thumbnailUrl": {{ . | jsonify | safeJS }},
|
2022-02-05 19:02:17 +00:00
|
|
|
{{- end }}
|
2022-02-14 15:25:11 +00:00
|
|
|
{{- with .Site.Params.GeekblogContentLicense }}
|
|
|
|
"license": "{{ .name }}",
|
2022-02-05 19:02:17 +00:00
|
|
|
{{- end }}
|
2022-02-14 15:25:11 +00:00
|
|
|
"inLanguage": {{ .Lang }}
|
2022-02-05 19:02:17 +00:00
|
|
|
}
|
|
|
|
</script>
|
2022-02-06 15:59:16 +00:00
|
|
|
{{- else if .IsPage }}
|
|
|
|
{{- $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors -}}
|
|
|
|
{{- $ac := 0 -}}
|
|
|
|
{{- $ac_max := default 0 (len $authors) -}}
|
2022-02-05 19:02:17 +00:00
|
|
|
|
|
|
|
<script type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "http://schema.org",
|
|
|
|
"@type": "BlogPosting",
|
2022-02-07 12:52:07 +00:00
|
|
|
"articleSection": "{{ .Section | humanize | title }}",
|
2022-02-06 11:46:10 +00:00
|
|
|
"name": "{{ (partial "utils/title" .) | safeJS }}",
|
2022-02-14 15:25:11 +00:00
|
|
|
"url" : {{ .Permalink | jsonify | safeJS }},
|
2022-02-06 11:46:10 +00:00
|
|
|
"headline": "{{ (partial "utils/title" .) | safeJS }}",
|
2022-02-05 19:02:17 +00:00
|
|
|
{{- with .Params.lead }}
|
|
|
|
"alternativeHeadline": "{{ . }}",
|
|
|
|
{{- end }}
|
|
|
|
{{- with partial "utils/description" . }}
|
2022-02-14 15:25:11 +00:00
|
|
|
"description": {{ trim (. | plainify) "\n" | jsonify | safeJS }},
|
2022-02-05 19:02:17 +00:00
|
|
|
{{- end }}
|
2022-02-14 15:25:11 +00:00
|
|
|
{{- with partial "utils/featured" . }}
|
|
|
|
"thumbnailUrl": {{ . | jsonify | safeJS }},
|
|
|
|
{{- end }}
|
|
|
|
"wordCount" : "{{ .WordCount }}",
|
|
|
|
{{- with .Site.Params.GeekblogContentLicense }}
|
|
|
|
"license": "{{ .name }}",
|
|
|
|
{{- end }}
|
|
|
|
"inLanguage": {{ .Lang }},
|
2022-02-05 19:02:17 +00:00
|
|
|
"isFamilyFriendly": "true",
|
|
|
|
"mainEntityOfPage": {
|
|
|
|
"@type": "WebPage",
|
2022-02-14 15:25:11 +00:00
|
|
|
"@id": {{ .Permalink | jsonify | safeJS }}
|
2022-02-05 19:02:17 +00:00
|
|
|
},
|
2022-02-14 15:25:11 +00:00
|
|
|
{{- with $tags := .Params.tags }}
|
|
|
|
"keywords" : [ {{ range $i, $tag := $tags }}{{ if $i }}, {{ end }}"{{ $tag }}" {{ end }}],
|
|
|
|
{{- end }}
|
2022-02-05 19:02:17 +00:00
|
|
|
{{- with $authors }}
|
|
|
|
"author" : [
|
|
|
|
{{- range sort . }}
|
|
|
|
{{- with . -}}
|
|
|
|
{{- $ac = (add $ac 1) }}
|
|
|
|
{{- $author := index $.Site.Data.authors . }}
|
|
|
|
{
|
|
|
|
"@type": "Person",
|
|
|
|
"name": "{{ $author.name }}"
|
|
|
|
}{{ if lt $ac $ac_max }},{{ end }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end }}
|
|
|
|
],
|
|
|
|
{{- end }}
|
|
|
|
"copyrightHolder" : "{{ .Site.Title }}",
|
|
|
|
"copyrightYear" : "{{ .Date.Format "2006" }}",
|
|
|
|
"dateCreated": "{{ .Date.Format "2006-01-02T15:04:05.00Z" | safeJS }}",
|
|
|
|
"datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05.00Z" | safeJS }}",
|
|
|
|
"dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05.00Z" | safeJS }}",
|
|
|
|
"publisher":{
|
|
|
|
"@type":"Organization",
|
|
|
|
"name": {{ .Site.Title }},
|
2022-02-14 15:25:11 +00:00
|
|
|
"url": {{ .Site.BaseURL | jsonify | safeJS }},
|
2022-02-05 19:02:17 +00:00
|
|
|
"logo": {
|
|
|
|
"@type": "ImageObject",
|
2022-02-14 15:25:11 +00:00
|
|
|
"url": {{ (default "brand.svg" .Site.Params.logo) | absURL | jsonify | safeJS }},
|
2022-02-05 19:02:17 +00:00
|
|
|
"width":"32",
|
|
|
|
"height":"32"
|
|
|
|
}
|
2022-02-14 15:25:11 +00:00
|
|
|
}
|
2022-02-05 19:02:17 +00:00
|
|
|
}
|
|
|
|
</script>
|
2022-02-06 15:59:16 +00:00
|
|
|
{{- end }}
|