1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
{{ if .IsPage }}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": {{ printf "%q" .Title }},
"datePublished": "{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}",
{{ with .Lastmod }}
"dateModified": "{{ .Format "2006-01-02T15:04:05Z07:00" }}",
{{ end }}
"author": {
"@type": "Person",
"name": {{ printf "%q" (site.Params.author.name | default site.Title) }}
},
"publisher": {
"@type": "Person",
"name": {{ printf "%q" site.Title }},
"logo": {
"@type": "ImageObject",
"url": "{{ site.Params.logo | absURL }}"
}
},
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Permalink }}"
},
"image": [
{{ with .Params.images }}"{{ (index . 0) | absURL }}"{{ end }}
]
}
</script>
{{ else if .IsHome }}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"url": "{{ site.BaseURL }}",
"name": {{ printf "%q" site.Title }},
"author": {
"@type": "Person",
"name": {{ printf "%q" (site.Params.author.name | default site.Title) }}
},
"publisher": {
"@type": "Person",
"name": {{ printf "%q" site.Title }}
}
}
</script>
{{ end }}
|