Skip to content

Commit 1d0cf7e

Browse files
author
Tim Bannister
committed
Tell crawlers not to index print pages
This logic is copied from the way that the Docsy code handles this.
1 parent 27daefa commit 1d0cf7e

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)