hugo-theme-relearn/layouts/partials/meta.html

35 lines
1.8 KiB
HTML
Raw Normal View History

<meta charset="utf-8">
2022-02-28 00:19:32 +00:00
{{- $c:=""}}{{/* to avoid that user swiping to the left leaves a gap on the right side, we set minimum-scale, even if not advised to */}}
<meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0, minimum-scale=1.0">
{{- if (ne .Site.Params.disableGeneratorVersion true) }}
{{- $gen := hugo.Generator }}
{{- $gen = replaceRE "\\s*/>$" ">" $gen }}
2022-07-07 19:42:45 +00:00
{{ $gen | safeHTML }}
{{- $ver := partial "version.txt" }}
{{- $ver := printf "<meta name=\"generator\" content=\"%s %s\">" "Relearn" $ver }}
2022-07-07 19:42:45 +00:00
{{ $ver | safeHTML }}
{{- end }}
{{- if not (and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }}
<meta name="robots" content="noindex, nofollow, noarchive, noimageindex">
{{- end }}
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
{{- $authorName := "" }}
{{- if .Site.Params.author }}
{{- if reflect.IsMap .Site.Params.author }}
{{- with .Site.Params.author.name }}
{{- $authorName = . }}
{{- end }}
{{- else }}
{{- warnf "According to Hugo 0.120.0 the author key in params configuration should now be a map and contain of name and email fields." }}
{{- $authorName = .Site.Params.author }}
{{- end }}
{{- else }}
{{- with .Site.Author.name }}
{{- $authorName = . }}
{{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }}
{{- end }}
{{- end }}
<meta name="author" content="{{ $authorName }}">
2023-10-11 16:01:58 +00:00
{{- partial "twitter_cards.html" . }}
{{- partial "opengraph.html" . }}