Initial version
This commit is contained in:
commit
ed5653a7fc
211 changed files with 11043 additions and 0 deletions
58
themes/zen/layouts/partials/meta_json_ld.html
Normal file
58
themes/zen/layouts/partials/meta_json_ld.html
Normal file
|
@ -0,0 +1,58 @@
|
|||
<script type="application/ld+json">
|
||||
{{ $blogSections := site.Params.blogSections | default (slice "blog" "post") -}}
|
||||
{{ $breadcrumbSections := site.Params.breadcrumbSections | default (slice) -}}
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
{{ if .IsPage -}}
|
||||
"@type": {{ if in $blogSections .Section }}"BlogPosting",{{ else }}"WebPage",
|
||||
{{ if in $breadcrumbSections .Section -}}
|
||||
"breadcrumb": {{ partial "meta_breadcrumb_json_ld.html" . }},
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
"headline": {{ .Title }},
|
||||
"datePublished": {{ .Date.Format "2006-01-02T15:04:05Z07:00" }},
|
||||
"dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }},
|
||||
"url" : {{ .Permalink }},
|
||||
{{ with (.Description | default (replaceRE "\n" " " (.Plain | truncate 170))) -}}
|
||||
"description": {{ . }},
|
||||
{{ end -}}
|
||||
{{ with .Params.tags -}}
|
||||
"keywords": {{ . }},
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
"@type": "WebPage",
|
||||
{{ if in $breadcrumbSections .Section -}}
|
||||
"breadcrumb": {{ partial "meta_breadcrumb_json_ld.html" . }},
|
||||
{{ end -}}
|
||||
"url" : {{ .Permalink }},
|
||||
"name": {{ .Title }},
|
||||
{{ with $.Param "description" -}}
|
||||
"description": {{ . }},
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ with $.Param "image" -}}
|
||||
"image" : {{ . | absURL }},
|
||||
{{ end -}}
|
||||
{{ with $.Param "author" -}}
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": {{ . }}
|
||||
},
|
||||
{{ end -}}
|
||||
"mainEntityOfPage": {
|
||||
"@type": "WebPage",
|
||||
"@id": {{ site.BaseURL }}
|
||||
},
|
||||
"publisher": {
|
||||
"@type": "Organization",
|
||||
"name": {{ site.Title }},
|
||||
{{ with $.Param "icon" -}}
|
||||
"logo" : {
|
||||
"@type": "ImageObject",
|
||||
"url": {{ . | absURL }}
|
||||
},
|
||||
{{ end -}}
|
||||
"url": {{ site.BaseURL }}
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue