feat(seo): add page param to block Google indexing

Add a `noindex` param to page front matter to block Google indexing for specific pages or directories. This is useful for avoiding duplicate content in search results or preventing indexing of pages that shouldn't appear in search engines.

- Adjust `head.html` for optional `noindex` param (default: false)
- Document usage in `configuration.md` and clarify Flexsearch section
This commit is contained in:
Matt Dodson
2025-05-17 18:35:26 -03:00
committed by GitHub
parent f194bc64e4
commit 128235e7e2
2 changed files with 21 additions and 3 deletions

View File

@ -1,7 +1,8 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{{ if hugo.IsProduction -}}
{{- $noindex := .Params.noindex | default false -}}
{{ if and (hugo.IsProduction) (not $noindex) -}}
<meta name="robots" content="index, follow" />
{{ else -}}
<meta name="robots" content="noindex, nofollow" />