Add global keywords for home page

original idea #311
This commit is contained in:
Aditya Telange 2021-03-31 10:00:31 +05:30
parent 196b82645e
commit 4878383dd4
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
1 changed files with 4 additions and 0 deletions

View File

@ -11,9 +11,13 @@
<title>{{ if .IsHome }}{{ else }}{{ if .Title }}{{ .Title }} | {{ end }}{{ end }}{{ .Site.Title }}</title> <title>{{ if .IsHome }}{{ else }}{{ if .Title }}{{ .Title }} | {{ end }}{{ end }}{{ .Site.Title }}</title>
{{- /* Meta */}} {{- /* 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 -}} <meta name="keywords" content="{{ if .Params.keywords -}}
{{- range $i, $e := .Params.keywords }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- else }} {{- range $i, $e := .Params.keywords }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- else }}
{{- range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- end -}}" /> {{- range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- end -}}" />
{{- end }}
<meta name="description" content="{{- with .Description }}{{ . }}{{- else }}{{- if .IsPage}} <meta name="description" content="{{- with .Description }}{{ . }}{{- else }}{{- if .IsPage}}
{{- .Summary | default (printf "%s - %s" .Title .Site.Title) }}{{- else }} {{- .Summary | default (printf "%s - %s" .Title .Site.Title) }}{{- else }}
{{- with .Site.Params.description }}{{ . }}{{- end }}{{- end }}{{- end -}}"> {{- with .Site.Params.description }}{{ . }}{{- end }}{{- end }}{{- end -}}">