diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2021-03-31 10:00:31 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2021-03-31 10:00:31 +0530 |
| commit | 4878383dd4370c682f974570718b08e6104fc9c3 (patch) | |
| tree | 1f05aa0c09c7ae25d936f47b850f864e7d669847 | |
| parent | 196b82645e33d171aeb36cb9da100f3382aac914 (diff) | |
Add global keywords for home page
original idea #311
| -rw-r--r-- | layouts/partials/head.html | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index e379533..3713b96 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -11,9 +11,13 @@ <title>{{ if .IsHome }}{{ else }}{{ if .Title }}{{ .Title }} | {{ end }}{{ end }}{{ .Site.Title }}</title> {{- /* Meta */}} +{{- if .IsHome }} +{{ with .Site.Params.keywords -}}<meta name="keywords" content="{{- range $i, $e := . }}{{ if $i }}, {{ end }}{{ $e }}{{ end }}" />{{ end }} +{{- else }} <meta name="keywords" content="{{ if .Params.keywords -}} {{- range $i, $e := .Params.keywords }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- else }} {{- range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- end -}}" /> +{{- end }} <meta name="description" content="{{- with .Description }}{{ . }}{{- else }}{{- if .IsPage}} {{- .Summary | default (printf "%s - %s" .Title .Site.Title) }}{{- else }} {{- with .Site.Params.description }}{{ . }}{{- end }}{{- end }}{{- end -}}"> |
