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
6 changed files with 31 additions and 115 deletions
|
|
@ -1,3 +1,14 @@
|
|||
{{ range .AlternativeOutputFormats -}}
|
||||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" title="{{ .Name }}" href="{{ .Permalink | safeURL }}">
|
||||
{{ end -}}
|
||||
<meta name="description" content="{{ if .IsPage }}{{ .Description | default (replaceRE "\n" " " .Summary) }}{{ else }}{{ $.Param "description" }}{{ end }}">
|
||||
<meta name="created" content="{{ .Date.Format "2006-01-02T15:04:05-0700" }}">
|
||||
<meta name="modified" content="{{ .Lastmod.Format "2006-01-02T15:04:05-0700" }}">
|
||||
{{ with $.Param "author" }}<meta name="author" content="{{ . }}">{{ end }}
|
||||
<meta property="og:site_name" content="{{ .Site.Title }}">
|
||||
<meta property="og:title" content="{{ .Title }}">
|
||||
<meta property="og:url" content="{{ .Permalink }}">
|
||||
{{ with $.Param "image" }}<meta name="og:image" content="{{ . | absURL }}">{{ end }}
|
||||
{{ hugo.Generator }}
|
||||
{{ with $.Param "contact" }}<meta name="contact" content="{{ . }}">{{ end }}
|
||||
<meta name="msapplication-TileColor" content="{{ $.Param "themecolor" | default "#ffffff" }}">
|
||||
|
|
|
|||
|
|
@ -1,12 +1,24 @@
|
|||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@context": "https://schema.org",
|
||||
{{ if .IsPage -}}
|
||||
"@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 .Params.tags -}}
|
||||
"keywords": {{ . }},
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
"@type": "WebPage",
|
||||
"url" : {{ .Permalink }},
|
||||
"name": {{ .Title }},
|
||||
{{ with $.Param "description" -}}
|
||||
"description": {{ . }},
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ with $.Param "image" -}}
|
||||
"image" : {{ . | absURL }},
|
||||
{{ end -}}
|
||||
|
|
@ -22,7 +34,7 @@
|
|||
},
|
||||
"publisher": {
|
||||
"@type": "Organization",
|
||||
"name": {{ .Site.Title }},
|
||||
"name": {{ .Site.Title }},
|
||||
{{ with $.Param "icon" -}}
|
||||
"logo" : {
|
||||
"@type": "ImageObject",
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{{ if .IsPage -}}
|
||||
<meta name="description" content="{{ .Description | default (replaceRE "\n" " " .Summary) }}">
|
||||
{{ else -}}
|
||||
<meta name="description" content="{{ $.Param "description" }}">
|
||||
{{ end -}}
|
||||
<meta property="og:site_name" content="{{ .Site.Title }}">
|
||||
<meta property="og:title" content="{{ .Title }}">
|
||||
<meta property="og:url" content="{{ .Permalink }}">
|
||||
{{ with $.Param "image" }}<meta name="og:image" content="{{ . | absURL }}">{{ end }}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{{ range .AlternativeOutputFormats -}}
|
||||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" title="{{ .Name }}" href="{{ .Permalink | safeURL }}">
|
||||
{{ end -}}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<meta name="created" content="{{ .Date.Format "2006-01-02T15:04:05-0700" }}">
|
||||
<meta name="modified" content="{{ .Lastmod.Format "2006-01-02T15:04:05-0700" }}">
|
||||
{{ with $.Param "author" }}<meta name="author" content="{{ . }}">{{ end }}
|
||||
Loading…
Reference in a new issue