[Feature Request #81]: Added support for customizable noindex in Hugo Pages

Signed-off-by: GitHub Action <action@github.com>
This commit is contained in:
GitHub Action
2024-09-09 12:29:13 +00:00
parent 76153454d4
commit 1ff47e11f0
3 changed files with 5 additions and 3 deletions

View File

@ -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 -}}

View File

@ -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" }}">