diff options
Diffstat (limited to 'layouts/partials')
| -rw-r--r-- | layouts/partials/head.html | 10 | ||||
| -rw-r--r-- | layouts/partials/keywords.html | 16 |
2 files changed, 16 insertions, 10 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 06ef255..0b480fd 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,4 +1,3 @@ -{{/* */}} <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,shrink-to-fit=no"> @@ -6,11 +5,10 @@ <link rel="canonical" href="{{ .Permalink }}"> <title>{{ block "title" . }}{{- partial "title.html" . -}}{{ end }}</title> - <meta name="description" content="{{ (partial "description.html" . ) }}"> - {{ if or .Params.tags site.Params.seoKeywords }} - <meta name="keywords" content="{{ (partial "keywords.html" . ) }}"> - {{ end }} - <meta name="author" content="{{ (partial "author.html" . ) }}"> + <meta name="description" content="{{ partial "description.html" . }}"> + <meta name="keywords" content="{{ partial "keywords.html" . }}"> + + <meta name="author" content="{{ partial "author.html" . }}"> {{ hugo.Generator }} {{- partial "styles.html" . }} diff --git a/layouts/partials/keywords.html b/layouts/partials/keywords.html index 275d52d..ab0dd2b 100644 --- a/layouts/partials/keywords.html +++ b/layouts/partials/keywords.html @@ -1,5 +1,13 @@ -{{- if .Params.tags -}} - {{- delimit .Params.tags ", " -}} -{{- else -}} - {{- delimit site.Params.seoKeywords ", " -}} +{{- $keywords := (slice) -}} + +{{- with .Keywords -}} + {{- $keywords = . -}} +{{- else }} + {{- with .Params.tags -}} + {{- $keywords = . -}} + {{- else -}} + {{- $keywords = site.Params.keywords | default slice -}} + {{- end -}} {{- end -}} + +{{- delimit $keywords ", " -}} |
