summaryrefslogtreecommitdiff
path: root/layouts/partials
diff options
context:
space:
mode:
authorAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-10-17 16:00:46 +0530
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-10-17 16:00:46 +0530
commit7db1be3d7349eaba2dd87bfeb240b8bc120f4663 (patch)
tree7e5b8e83210ec4bf2f7175fc221ac777c08a72c6 /layouts/partials
parent353146891e2e3c38600b406efd904d35b5debc86 (diff)
head: update description and keywords logic
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/head.html13
1 files changed, 6 insertions, 7 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 1f78628..41a6b6d 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -4,13 +4,12 @@
<!-- Title -->
<title>{{ if .IsHome }}{{else}}{{ if .Title }}{{ .Title }} - {{ end }}{{end}}{{ .Site.Title }}</title>
<!-- Meta -->
-{{- if in site.Params.mainSections .Type }}
-<meta name="description" content="{{ .Summary }}">
-<meta name="keywords" content={{ delimit .Keywords ", " }} />
-{{- else }}
-<meta name="description"
- content="{{if .IsHome}}{{ .Site.Params.description }}{{else}}{{ .Title }} - {{ .Site.Title }}{{end}}">
-{{- end }}
+<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 -}}" />
+<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 -}}">
<meta name="author" content="{{ .Params.author | default .Site.Params.author }}">
<link rel="canonical" href="{{ .Permalink }}" />
{{- if .Site.Params.analytics.google.SiteVerificationTag }}