From 1d0cf7e97180fbab728de1cd67064bb3ade440c7 Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Sun, 30 Oct 2022 13:15:30 +0000 Subject: [PATCH] Tell crawlers not to index print pages This logic is copied from the way that the Docsy code handles this. --- layouts/partials/head.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index acd6da510bf60..74a60c83bec82 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,11 +1,12 @@ {{- $isBlogPost := eq .Section "blog" }} {{- $ogType := cond (.IsHome) "website" "article" }} - -{{- if hugo.IsProduction -}} - -{{- else -}} - -{{- end -}} + +{{ $outputFormat := partial "outputformat.html" . -}} +{{ if and hugo.IsProduction (ne $outputFormat "print") -}} + +{{ else -}} + +{{ end -}} {{ range .Translations -}}