Skip to content

When page-no-index is defined, configure noindex on googlebot and bingbot as well #31

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

Closed
ggrossetie opened this issue Jan 11, 2021 · 0 comments · Fixed by #32
Closed
Labels
bug Something isn't working

Comments

@ggrossetie
Copy link
Contributor

Currently, the page-no-index attribute does not apply to googlebot or bingbot:

{{#if (ne page.attributes.no-index undefined) }}
<meta name="robots" content="noindex" />
{{else}}
<meta name="robots" content="index, follow" />
{{/if}}
<meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
<meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />

We should probably fix the condition:

{{#if (ne page.attributes.no-index undefined) }}
  <meta name="robots" content="noindex" />
  <meta name="googlebot" content="noindex" />
  <meta name="bingbot" content="noindex" />
{{else}}
  <meta name="robots" content="index, follow" />
  <meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
  <meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
{{/if}}
@ggrossetie ggrossetie added the bug Something isn't working label Jan 11, 2021
ggrossetie added a commit that referenced this issue Jan 14, 2021
resolves #31 noindex on googlebot and bingbot when page-no-index is defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant