hugo-theme-relearn/layouts/partials/meta.html
Sören Weber 7f0057bcd9
hidden pages: hide search index #102
if user disabled SEO or search
2021-09-27 20:06:39 +02:00

21 lines
No EOL
1 KiB
HTML

{{- partial "page-meta.go" . }}
{{- if not (and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }}
<meta name="robots" content="noindex, nofollow, noarchive, noimageindex">
{{- else }}
{{- range .AlternativeOutputFormats }}
{{- if ne .Name "JSON" }}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{- end }}
{{- end }}
{{- end }}
{{- if and (ne .Site.Params.disableSeoHiddenPages true) (ne .Site.Params.disableSearchHiddenPages true) }}
{{- range .AlternativeOutputFormats }}
{{- if eq .Name "JSON" }}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{- end }}
{{- end }}
{{- end }}
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
{{- with .Site.Params.author }}
<meta name="author" content="{{ . }}">
{{- end }}