Merge partials for head and add logic so they can be added once in baseof instead of in each single and list template.
This commit is contained in:
parent
e8c04dfc8e
commit
9eea6f46a9
1 changed files with 31 additions and 115 deletions
|
|
@ -1,38 +0,0 @@
|
|||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": {{ if or (eq .Section "blog") (eq .Section "post") }}"BlogPosting"{{ else }}"WebPage"{{ end }},
|
||||
"headline": {{ .Title }},
|
||||
"datePublished": {{ .Date.Format "2006-01-02T15:04:05Z07:00" }},
|
||||
"dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }},
|
||||
"url" : {{ .Permalink }},
|
||||
"description": {{ with (.Description | default (replaceRE "\n" " " .Summary)) }}{{ . }}{{ end }},
|
||||
{{ with $.Param "image" -}}
|
||||
"image" : {{ . | absURL }},
|
||||
{{ end -}}
|
||||
{{ with .Params.tags -}}
|
||||
"keywords": {{ . }},
|
||||
{{ 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…
Reference in a new issue