Skip to content

Commit 7a25248

Browse files
author
Ben Zörb
authored
Merge pull request #48 from jungvonmatt/fix/404-page-robots
Fix: 404 page meta robots tag
2 parents 3a4a20d + 7d0a571 commit 7a25248

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hugo-modules/core/utils/seo/private/get-tags.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@
9898
{{ with $seo }}
9999
{{ $value := "noindex, nofollow" }}
100100
{{ $production := eq (getenv "HUGO_ENV") "production" }}
101-
{{ $index := cond (eq .no_index true) "noindex" "index" }}
102-
{{ $follow := cond (eq .no_follow true) "nofollow" "follow" }}
101+
{{ $is_404 := eq $.Page.Kind "404" }}
102+
{{ $index := cond (or (eq .no_index true) $is_404) "noindex" "index" }}
103+
{{ $follow := cond (or (eq .no_follow true) $is_404) "nofollow" "follow" }}
103104

104105
{{ if and $production }}
105106
{{ $value = (print $index ", " $follow) }}

0 commit comments

Comments
 (0)