Skip to content

Commit

Permalink
list pages with robotsNoIndex in robots.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
martin2250 committed Apr 30, 2022
1 parent 7e03764 commit 724b999
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions layouts/robots.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
User-agent: *
{{- if hugo.IsProduction | or (eq site.Params.env "production") }}
{{- $noIndexPages := where .Site.Pages "Params.robotsNoIndex" true }}
{{- range $noIndexPages }}
Disallow: {{ .RelPermalink }}
{{- end }}
{{- if not $noIndexPages }}
Disallow:
{{- end }}
{{- else }}
Disallow: /
{{- end }}
Expand Down

0 comments on commit 724b999

Please sign in to comment.