Skip to content

Commit dc09cc7

Browse files
authored
Merge pull request #37604 from sftim/20221030_skip_indexing_print_output
Tell crawlers not to index print pages
2 parents 41013a3 + 1d0cf7e commit dc09cc7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

layouts/partials/head.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{{- $isBlogPost := eq .Section "blog" }}
22
{{- $ogType := cond (.IsHome) "website" "article" }}
3-
<!-- per-page robot indexing controls -->
4-
{{- if hugo.IsProduction -}}
5-
<meta name="ROBOTS" content="INDEX, FOLLOW">
6-
{{- else -}}
7-
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
8-
{{- end -}}
3+
4+
{{ $outputFormat := partial "outputformat.html" . -}}
5+
{{ if and hugo.IsProduction (ne $outputFormat "print") -}}
6+
<meta name="robots" content="index, follow">
7+
{{ else -}}
8+
<meta name="robots" content="noindex, nofollow">
9+
{{ end -}}
910

1011
<!-- alternative translations -->
1112
{{ range .Translations -}}

0 commit comments

Comments
 (0)