diff --git a/content/posts/explaining-configs.md b/content/posts/explaining-configs.md index 059b373..f3c6bc2 100644 --- a/content/posts/explaining-configs.md +++ b/content/posts/explaining-configs.md @@ -101,7 +101,8 @@ Lastmod : 2024-03-12T20:30:30+05:30 - `pin` : Specify if the post should be shown as pinned - `denyRobots` : Specify what directives to follow when denying crawlers. Default is **noindex, nofollow, noarchive** - `allowRobots` : Specify what directives to follow when allowing crawlers. Default is **index, follow** -- `noIndex` : When set to true, whole site will have ___noindex, nofollow, noarchive___ (unless specified by `denyRobots`) added to robots meta tag. Else, robots tag will have ___index, follow___ (unless specified by `allowRobots`) applied to whole site +- `siteNoIndex` : When set to true, whole site will have ___noindex, nofollow, noarchive___ (unless specified by `denyRobots`) added to robots meta tag. Else, robots tag will have ___index, follow___ (unless specified by `allowRobots`) applied to whole site +- `noIndexPages` : Specify on which pages crawlers will be denied. Use **Page title** to select pages. Useful for the pages generated by Hugo. (Eg. for [List of Tags]({{}}), use ___Tags___) ## Special Caveats diff --git a/hugo.toml b/hugo.toml index b3a060f..147c48e 100644 --- a/hugo.toml +++ b/hugo.toml @@ -117,7 +117,8 @@ expiryDate = ["expiryDate"] human = ["single","posts"] # denyRobots = "noindex, nofollow, noarchive" # allowRobots = "index, follow" - # noIndex = false + # siteNoIndex = false + # noIndexPages = ["404 Page not found"] [[params.socialLinks]] name = "github" 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 -}}