2022-02-18 13:03:19 +00:00
|
|
|
{{ $isPage := or (and (ne .Type "posts") (in "section page" .Kind )) (and (eq .Type "posts") (eq .Kind "page")) }}
|
2022-02-15 21:27:43 +00:00
|
|
|
{{- if eq .Kind "home" }}
|
2022-02-07 09:57:43 +00:00
|
|
|
<script type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "http://schema.org",
|
|
|
|
"@type": "WebSite",
|
2022-02-15 21:27:43 +00:00
|
|
|
"name": {{ .Site.Title }},
|
2024-01-07 15:24:22 +00:00
|
|
|
"url": {{ .Site.Home.Permalink }},
|
2022-02-07 09:57:43 +00:00
|
|
|
{{- with partial "utils/description" . }}
|
2022-02-15 21:27:43 +00:00
|
|
|
"description": "{{ . | plainify | htmlUnescape | chomp }}",
|
2022-02-07 09:57:43 +00:00
|
|
|
{{- end }}
|
2022-02-15 21:27:43 +00:00
|
|
|
{{- with partial "utils/featured" . }}
|
|
|
|
"thumbnailUrl": {{ . }},
|
2022-02-07 09:57:43 +00:00
|
|
|
{{- end }}
|
2023-06-22 07:45:54 +00:00
|
|
|
{{- with .Site.Params.geekdocContentLicense }}
|
2022-02-16 10:53:13 +00:00
|
|
|
"license": "{{ .name }}",
|
|
|
|
{{- end }}
|
2022-02-15 21:27:43 +00:00
|
|
|
"inLanguage": {{ .Lang }}
|
2022-02-07 09:57:43 +00:00
|
|
|
}
|
|
|
|
</script>
|
2022-02-18 13:03:19 +00:00
|
|
|
{{- else if $isPage }}
|
2022-02-07 09:57:43 +00:00
|
|
|
<script type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "http://schema.org",
|
|
|
|
"@type": "TechArticle",
|
|
|
|
"articleSection": "{{ .Section | humanize | title }}",
|
2022-02-15 21:27:43 +00:00
|
|
|
"name": {{ partial "utils/title" . }},
|
|
|
|
"url" : {{ .Permalink }},
|
|
|
|
"headline": {{ partial "utils/title" . }},
|
|
|
|
{{- with .Params.lead }}
|
|
|
|
"alternativeHeadline": {{ . }},
|
|
|
|
{{- end }}
|
2022-02-07 09:57:43 +00:00
|
|
|
{{- with partial "utils/description" . }}
|
2022-02-15 21:27:43 +00:00
|
|
|
"description": "{{ . | plainify | htmlUnescape | chomp }}",
|
|
|
|
{{- end }}
|
|
|
|
{{- with partial "utils/featured" . }}
|
|
|
|
"thumbnailUrl": {{ . }},
|
2022-02-07 09:57:43 +00:00
|
|
|
{{- end }}
|
2022-02-15 21:27:43 +00:00
|
|
|
"wordCount" : "{{ .WordCount }}",
|
2023-06-22 07:45:54 +00:00
|
|
|
{{- with .Site.Params.geekdocContentLicense }}
|
2022-02-16 10:53:13 +00:00
|
|
|
"license": "{{ .name }}",
|
|
|
|
{{- end }}
|
2022-02-15 21:27:43 +00:00
|
|
|
"inLanguage": {{ .Lang }},
|
2022-02-07 09:57:43 +00:00
|
|
|
"isFamilyFriendly": "true",
|
|
|
|
"mainEntityOfPage": {
|
|
|
|
"@type": "WebPage",
|
2022-02-15 21:27:43 +00:00
|
|
|
"@id": {{ .Permalink }}
|
2022-02-07 09:57:43 +00:00
|
|
|
},
|
2022-02-15 21:27:43 +00:00
|
|
|
{{- with $tags := .Params.tags }}
|
|
|
|
"keywords" : [ {{ range $i, $tag := $tags }}{{ if $i }}, {{ end }}"{{ $tag }}" {{ end }}],
|
|
|
|
{{- end }}
|
2022-02-07 09:57:43 +00:00
|
|
|
"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 }},
|
2024-01-07 15:24:22 +00:00
|
|
|
"url": {{ .Site.Home.Permalink }},
|
2022-02-07 09:57:43 +00:00
|
|
|
"logo": {
|
|
|
|
"@type": "ImageObject",
|
2022-02-15 21:27:43 +00:00
|
|
|
"url": {{ (default "brand.svg" .Site.Params.logo) | absURL }},
|
2022-02-07 09:57:43 +00:00
|
|
|
"width":"32",
|
|
|
|
"height":"32"
|
|
|
|
}
|
2022-02-15 21:27:43 +00:00
|
|
|
}
|
2022-02-07 09:57:43 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{{- end }}
|