diff --git a/hugo.toml.example b/hugo.toml.example index 2201df9..08a8336 100644 --- a/hugo.toml.example +++ b/hugo.toml.example @@ -116,7 +116,8 @@ expiryDate = ["expiryDate"] # noIndex = false # denyRobots = "noindex, nofollow, noarchive" # allowRobots = "index, follow" - # noIndex = false + # siteNoIndex = false + # noIndexPages = ["404 Page not found"] [[params.socialLinks]] diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 12cd30c..1c3add0 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -20,7 +20,8 @@ {{- end -}} {{- block "head" . -}}{{- end -}} -{{- if templates.Exists "partials/extra-head.html" -}}{{- partial "extra-head.html" . -}}{{- end -}} +{{- if templates.Exists "partials/extra-head.html" -}}{{- partial "extra-head.html" . -}}{{- end -}} + {{- if .Site.Params.googleTagManager -}}{{- partial "googleTagManager_body.html" . -}}{{- end -}} {{- block "header" . -}}{{ end -}} diff --git a/layouts/partials/site-meta.html b/layouts/partials/site-meta.html index b3561cd..4fce7cd 100644 --- a/layouts/partials/site-meta.html +++ b/layouts/partials/site-meta.html @@ -2,7 +2,7 @@ -{{- if (or (in .Page.RelPermalink "404") (or .Site.Params.noIndex .Params.noIndex)) -}} +{{- if (or (in .Page.RelPermalink "404") (or .Site.Params.siteNoIndex .Params.noIndex) (in .Site.Params.noIndexPages .Title)) -}} {{- else -}}