mirror of
https://github.com/imfing/hextra.git
synced 2025-06-20 01:21:25 -04:00
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:
@ -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" />
|
||||
|
Reference in New Issue
Block a user