Tell crawlers not to index print pages

This logic is copied from the way that the Docsy code handles this.
pull/37604/head
Tim Bannister 2022-10-30 13:15:30 +00:00
parent 27daefaa2a
commit 1d0cf7e971
No known key found for this signature in database
GPG Key ID: 1E76582C4F66FA48
1 changed files with 7 additions and 6 deletions

View File

@ -1,11 +1,12 @@
{{- $isBlogPost := eq .Section "blog" }}
{{- $ogType := cond (.IsHome) "website" "article" }}
<!-- per-page robot indexing controls -->
{{- if hugo.IsProduction -}}
<meta name="ROBOTS" content="INDEX, FOLLOW">
{{- else -}}
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
{{- end -}}
{{ $outputFormat := partial "outputformat.html" . -}}
{{ if and hugo.IsProduction (ne $outputFormat "print") -}}
<meta name="robots" content="index, follow">
{{ else -}}
<meta name="robots" content="noindex, nofollow">
{{ end -}}
<!-- alternative translations -->
{{ range .Translations -}}