add site specific title and meta attributes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2019-02-07 00:31:34 +01:00
parent 8b5b877b52
commit 4d151144e3

View File

@ -1,27 +1,25 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
{{- $defaultTitle := ( printf "%s - %s" .Site.Title .Site.Params.longTitle ) }}
{{- $title := .Title | default $defaultTitle }}
{{- $description := .Page.Description }}
{{- $keywords := .Page.Keywords }}
{{- $author := index $.Site.Data.authors (.Page.Params.Author | default .Site.Params.author) }}
{{- if .IsHome }}
{{- $author := index $.Site.Data.authors .Site.Params.author }}
{{- with .Site.Params.description }}
{{ $title = $defaultTitle }}
{{ $description = .Site.Params.description }}
{{ $keywords = .Site.Params.keywords }}
{{- end }}
{{- with $description }}
<meta name="description" content="{{ . }}">
{{- end }}
{{- with .Site.Params.keywords }}
{{- with $keywords }}
<meta name="keywords" content="{{ delimit . "," }}">
{{- end }}
<meta name="author" content="{{ $author.name }}">
{{- else if in .Page.URL "/posts/" }}
{{- with .Page.Description }}
<meta name="description" content="{{ . }}">
{{- end }}
{{- with .Page.Keywords }}
<meta name="keywords" content="{{ delimit . "," }}">
{{- end }}
{{- with .Page.Params.Author }}
{{- $author := index $.Site.Data.authors . }}
{{- with $author }}
<meta name="author" content="{{ $author.name }}">
{{- end }}
{{- end }}
<title>{{ .Site.Title }} - {{ .Site.Params.longTitle }}</title>
<title>{{ $title }}</title>
<link rel="shortcut icon" href="/favicon.ico">
<link rel="icon" type="image/png" href="/favicon.png" sizes="32x32">
<link rel="icon" type="image/png" href="/favicon.png" sizes="96x96">