hugo-geekblog/layouts/partials/head/meta.html

33 lines
1.1 KiB
HTML
Raw Normal View History

<meta charset="UTF-8" />
<meta name="referrer" content="no-referrer" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{{ hugo.Generator }}
2020-07-25 11:53:27 +00:00
{{- $keywords := default .Site.Params.Keywords .Keywords -}}
{{- $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors -}}
{{- $seoIgnore := default (slice "taxonomy" "section" "term" "404") .Site.Params.GeekblogSeoIgnore -}}
2020-07-25 11:53:27 +00:00
{{- if not (in $seoIgnore .Kind) }}
<meta name="robots" content="index, follow" />
{{- else }}
<meta name="robots" content="noindex, nofollow" />
{{- end }}
{{- with partial "utils/description" . }}
2022-02-14 21:58:34 +00:00
<meta name="description" content="{{ . | plainify | htmlUnescape | chomp }}" />
{{- end }}
{{- with $keywords }}
<meta name="keywords" content="{{ delimit . "," }}" />
{{- end }}
{{- with $authors }}
{{- $list := slice -}}
{{- range sort . }}
{{- with . }}
{{- $author := index $.Site.Data.authors . -}}
{{- $list = $list | append $author.name -}}
{{- end }}
{{- end }}
{{- with $list }}
<meta name="author" content="{{ delimit . "," }}" />
{{- end }}
{{- end }}