-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feat(gatsby-plugin-netlify-cms): Add includeRobots #16662
Conversation
277095a
to
9279f80
Compare
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.
Thank you @tdukart 👍
Left some comments!
@@ -161,6 +162,9 @@ exports.onCreateWebpackConfig = ( | |||
favicon: htmlFavicon, | |||
chunks: [`cms`], | |||
excludeAssets: [/cms.css/], | |||
meta: { | |||
robots: excludeRobots ? `noindex` : ``, // Ensure search engines don't index this page. |
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.
robots: excludeRobots ? `noindex` : ``, // Ensure search engines don't index this page. | |
robots: excludeRobots ? `none` : `all`, // Ensure search engines don't index or follow links on this page |
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.
Done
@@ -178,6 +178,13 @@ bar). | |||
Customize the value of the `favicon` tag in your CMS HTML (shows in the browser | |||
bar). | |||
|
|||
### `excludeRobots` |
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 flip this over to includeRobots
since this is opt-in and by default it is not included
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.
And done
9279f80
to
10cd295
Compare
noindex
to Netlify CMS page
Holy buckets, @tdukart — we just merged your PR to Gatsby! 💪💜 Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! |
Published in |
Woo! Thanks for your quick review! |
Description
In
gatsby-plugin-netlify-cms
Adds a meta tag to the<head>
of the Netlify CMS to request robots (like Googlebot) to not index the page. That way the admin can be hidden from search engines since it's not something that many (most?) site owners want publicly accessible.It's on by default but I added an option to the config so it can be turned off if the site owner desires.
Related Issues
None (can make one if you want)