Skip to content

Commit

Permalink
Merge pull request #37604 from sftim/20221030_skip_indexing_print_output
Browse files Browse the repository at this point in the history
Tell crawlers not to index print pages
  • Loading branch information
k8s-ci-robot authored Nov 12, 2022
2 parents 41013a3 + 1d0cf7e commit dc09cc7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -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 -}}
Expand Down

0 comments on commit dc09cc7

Please sign in to comment.