[Feature Request #81]: Added support for customizable noindex in Hugo Pages
Signed-off-by: GitHub Action <action@github.com>
This commit is contained in:
@ -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]]
|
||||
|
@ -20,7 +20,8 @@
|
||||
<link rel="stylesheet preload prefetch" as="style" href="{{ $c_css.Permalink }}" {{ printf "integrity=%q" $c_css.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous">
|
||||
{{- end -}}
|
||||
{{- block "head" . -}}{{- end -}}
|
||||
{{- if templates.Exists "partials/extra-head.html" -}}{{- partial "extra-head.html" . -}}{{- end -}}</head>
|
||||
{{- if templates.Exists "partials/extra-head.html" -}}{{- partial "extra-head.html" . -}}{{- end -}}
|
||||
</head>
|
||||
<body id="page">
|
||||
{{- if .Site.Params.googleTagManager -}}{{- partial "googleTagManager_body.html" . -}}{{- end -}}
|
||||
{{- block "header" . -}}{{ end -}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
{{- 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)) -}}
|
||||
<meta name="robots" content="{{ .Site.Params.denyRobots | default "noindex, nofollow, noarchive" }}">
|
||||
{{- else -}}
|
||||
<meta name="robots" content="{{ .Site.Params.allowRobots | default "index, follow" }}">
|
||||
|
Reference in New Issue
Block a user