-
-
Notifications
You must be signed in to change notification settings - Fork 355
Add page param to block google indexing #671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for hugo-hextra ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
By the way, I tested the mod on my fork, and the logic is currently used aon https://docs.rhize.com : At time of writing, though, only draft pages at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds an optional "noindex" parameter in page front matter to block Google indexing, and updates both the theme's head template and documentation accordingly.
- Introduces a new variable in head.html to control the robots meta tag based on the "noindex" parameter.
- Updates the documentation in configuration.md to explain how to use the parameter, and renames the "Search Index" heading to "FlexSearch Index" for clarity.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| layouts/partials/head.html | Adjusts meta tag logic to conditionally render index/follow tags. |
| exampleSite/content/docs/guide/configuration.md | Updates documentation to include the new noindex configuration and improves heading clarity. |
|
|
||
| ```yaml | ||
| title: Configuration (archive version) | ||
| noindex: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's put it under params?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, just updated. 8d83c37
Never knew that was the recommended way.
|
To test locally:
params:
noindex: true
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
This param completely blocks a page or directory from being indexed on Google. Useful for avoiding indexing duplicate content or any other page that shouldn't appear in search results.
head.htmlfor optionalnoindexparam, make default valuefalseconfiguration.md. I also modified the Flexsearch section to be explicit about what "search index" means on different parts of the page.