Skip to content
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

add noindex parameter #466

Merged
merged 4 commits into from
Apr 29, 2024
Merged

add noindex parameter #466

merged 4 commits into from
Apr 29, 2024

Conversation

stdevel
Copy link
Contributor

@stdevel stdevel commented Mar 29, 2024

This PR adds the possibility to set the noindex meta parameter in order to preventing search engine from indexing a particular post or page.

To enable it, the following line needs to be added to the front matter:

noindex: true

Successfully tested on one of my websites.

Pull Request type

  • Bug-fix
  • Feature (functionality, design, translations, etc.)
  • Documentation change
  • Project management (tests, CI, GitHub configuration, etc.)
  • Other (please describe):

Current state

All pages or posts can be indexed by search engines.

Issue Number(s): #465

Proposed changes

It adds a parameter noindex that can be set in the front matter. If set, the following HTML meta tag is set:

<meta name="robots" content="noindex" />

Screenshots, if applicable

grafik

Checklist

  • Bug-fixes and new features: I have tested locally with the latest release of Hugo extended. This requirement is a standard.
  • Bug-fixes, new features, and doc changes: I have updated the relevant documentation as part of this PR.
  • All PRs: I have signed off (using git commit -s ...), or if not possible due to developer environment constraints, will comment below confirming that I am adhering to the Developer Certificate of Origin.

I work consistent with the Developer Certificate of Origin.

@rterakedis
Copy link
Contributor

Hello @stdevel,

It looks like you added "noindex" in the Site Params section in the README file (i.e. .Site.Params.noindex). However, in the partial you've referenced the Page params (from the front matter of a page): {{ if .Params.noindex }}

You may need to move the row in the README table down into the Page Params section if that's the intent of the partial.

stdevel added 4 commits April 28, 2024 21:00
Signed-off-by: Christian Stankowic <info@cstan.io>
Signed-off-by: Christian Stankowic <info@cstan.io>
Signed-off-by: Christian Stankowic <info@cstan.io>
Signed-off-by: Christian Stankowic <info@cstan.io>
@stdevel
Copy link
Contributor Author

stdevel commented Apr 28, 2024

Hi @rterakedis,
you're so right - thanks for pointing out!

I added another commit to fix this.
Let me know if this works for you now.

@onweru onweru merged commit 8412edb into chipzoller:master Apr 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants