-
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
docs(blog): add seo and gatsby blog post #10780
Conversation
Nice, I like that you included the image part. I gave a lengthy explanation to that on Discord couple of days ago, so now I can link to a blogpost then. Did you link to the "Add an SEO component" doc? What about linking to JSONLD and/or an example with that? |
@LekoArts definitely will want to add the link(s) in! |
Hey @DSchau I was asked my Kyle to have a read through the article, here are some bullet-pointed notes I took for it: -- meta keywords is entirely ignored by Google both for ranking and indexing, and has been for many years. Indeed, it is a signal to Google if the meta keywords is stuffed with nonsense to consider it SEO spam. Some other search engines do look at it, tho. -- The <title> tag is far more important to SEO, so perhaps mention that in place of meta keywords for the bare minimum -- meta images should be sized appropriately, and in the appropriate aspect ratio for the social service in question, and in the right image format. Both Twitter and Facebook have size restrictions for images beyond which they will just completely ignore the image -- Article doesn't seem to discuss the recommended title length and description lengths, which is relatively important... and to truncate them appropriately -- The article probably should discuss -- Probably beyond the scope, but the article doesn't touch on JSON-LD structured data, which is increasingly important to the Google Knowledge Graph as well as the Google SERP in terms of presentation Other things that may or may not be beyond the scope of the article: -- Sitemaps and how GoogleBot uses them to help spend its crawl budget where you want it to -- -- -- -- 301 redirects when an old site is redone into a shiny new site, with presumably rewritten URLs -- Not SEO related, but might be kinda cool of Gatsby includes a humans.txt as a default part of the template; if so, add in an Otherwise, it looks okay i guess? I'm slightly unclear on the premise of the article; if it's just a lightweight example of "How to SEO with Gastby" then it probably is fine. Perhaps it should talk a bit more about each page should have a unique title & description that reflects the content on the page... and to avoid duplicate descriptions/titles I'd consider mentioning the importance of speed as it pertains to SEO as well, especially since Gatsby addresses performance so well. GoogleBot has a "performance budget" in time that it uses to crawl your site; the faster the site, the more it can crawl. You will also get a boost in the SERP if your site is:
...so sell Gatsby on these benefits that it provides! If I can offer any other assistance/input, please feel free to ask! Some articles I wrote that may be useful: https://nystudio107.com/blog/modern-seo-snake-oil-vs-substance https://nystudio107.com/blog/json-ld-structured-data-and-erotica SEO presentation I did back in 2017: |
@khalwat you’re the best—thank you so much! I’ll address this feedback tomorrow and get it ship-shape. |
Don't get me wrong, it's quite good -- and the hard part of any article is deciding: 1 - What it should be ...but if you have any specific questions or things you want to run by me, feel free! |
@khalwat Thanks for your insights, will read through the articles tomorrow. Regarding the JSONLD: https://github.com/LekoArts/gatsby-starter-prismic/blob/master/src/components/SEO/SEO.jsx |
@LekoArts So it looks fine... you probably always want to have: -- Something that is a main entity of page (not only if it is an Take a look at how the Google Structured Data Testing Tool consumes the JSON-LD for my An Annotated webpack 4 Config for Frontend Web Development article page (disclose the Article and see everything that's filled in). This was generated by the SEOmatic plugin that I wrote for Craft CMS. The generated JSON-LD looks like this:
Note that it includes an Also note that even though it is a "Blog" we're using the There is what is defined on schema.org, and then there are the specific sub-types that Google looks for and consumes. |
Thanks for the tips!
What do you mean with that? |
From the code I looked it, it appeared to me that it wasn't adding a JSON-LD object that was the Yes, it's true, that by default Google assumes everything is a EDIT -- okay I see, I misread the code. It looks like you include |
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.
Love the length, organization, and tone of this article! I agree it could be made into a guide also, with just slight editing.
Just made some suggestions. One overall suggestion is to shift from "let's" and "we" to "you" oriented language to focus it on the reader more. This is what we decided to do in the docs, though no decision has been made for the blog. It would just make it easier to make this into a guide and also potentially focuses all the reasons and instructions squarely on the reader
date: 2019-01-04 | ||
author: Dustin Schau | ||
cover: images/seo.jpg | ||
excerpt: "SEO and Gatsby: A Perfect Pairing. Learn how Gatsby implements SEO utilizing React Helmet and smart defaults and how you can use these tools to implement your own!" |
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.
I've been relentlessly trained to prefer "using" to "utilizing" simply because it's one syllable shorter.
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.
It could also be shorter "Learn how to use Gatsby to implement SEO with React Helmet and smart defaults!
/> | ||
``` | ||
|
||
These are the _bare minimum_ requirements that should be implemented for simple and basic SEO. However--we can go further, and we can go further with the powerful combo of content rendered at _build time_ powered by Gatsby and GraphQL. Let's dive in. |
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.
we can go further is repeated twice.
|
||
### `StaticQuery` | ||
|
||
Gatsby distinguishes between page-level queries and component queries. The former can use page GraphQL queries while the latter can use a new in Gatsby v2 feature called [`StaticQuery`][gatsby-static-query]. A StaticQuery will be parsed, evaluated, and injected at _build time_ into the component that is requesting the data. This is a perfect scenario in which we can create an SEO component with sane defaults that can be easily extended. |
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.
Maybe this is obvious to readers; since it isn't obvious to me, I'll just ask: why is this a perfect scenario for an SEO component?
|
||
Gatsby distinguishes between page-level queries and component queries. The former can use page GraphQL queries while the latter can use a new in Gatsby v2 feature called [`StaticQuery`][gatsby-static-query]. A StaticQuery will be parsed, evaluated, and injected at _build time_ into the component that is requesting the data. This is a perfect scenario in which we can create an SEO component with sane defaults that can be easily extended. | ||
|
||
### Creating the component |
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.
I think this header and first sentence could be more specific for easier scanning
|
||
> Note: `react-helmet` is enabled, by default, in gatsby-starter-default and gatsby-starter-blog | ||
> | ||
> If you're not using those: [follow this guide for installation instructions][gatsby-plugin-react-helmet] |
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.
"those starters," (could be obvious, though also could easily be confused as referring to react-helmet
plus one of the starters, which is close to what you mean, just not exactly the same)
export default SEO | ||
``` | ||
|
||
whew, getting closer! This will now render the `meta` `description` tag, and will do so using content injected at build-time with the `StaticQuery` component. Additionally, it will add the `lang="en"` attribute to our root-level `html` tag to silence that pesky Lighthouse warning 😉 |
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.
Whew
|
||
whew, getting closer! This will now render the `meta` `description` tag, and will do so using content injected at build-time with the `StaticQuery` component. Additionally, it will add the `lang="en"` attribute to our root-level `html` tag to silence that pesky Lighthouse warning 😉 | ||
|
||
If you remember earlier, I claimed this was the bare bones, rudimentary approach to SEO, and that still holds true. Let's enhance this functionality this and get some useful functionality for sharing a page via social networks like Facebook, Twitter, and Slack. |
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.
delete second "this"
ping @gatsbyjs/ecosystem |
I would suggest removing the keywords meta, like mentioned above, google does not use this at all. |
This is probably still publishable--however it would be nice to have #10921 merged in, as well (which is currently blocked). I think SEO is a thing people kinda/sorta understand--so providing some general, helpful info would be very valuable! |
This is fantastic learning material! However, I do think it would make a better Docs Reference Guide or Advanced Tutorial, since blog post material is usually more about storytelling than how-to's (at least in where you'd look for them). After a while it also would get buried amongst blog posts, so I think that will be important in the long run to help people find your awesome contribution. The SEO page is pretty light on details, too, perhaps we could add it to "Tutorials > Advanced Tutorials" and link from the Docs Guide (dependent on #14071)? To also echo what @shannonbux said, too: referencing "you" will focus the narrative on the reader. |
Closed in favor of #14125! |
Description
This PR adds a blog post re: SEO + Gatsby, with a particular focus on the new SEO component we've made available in the default and blog starters.
I'm open to tweaking this however (or making a guide?), but didn't want to overwrite anything existing content and it does seem to make sense as a blog post.
As always, feedback more than welcome, and huge shout-out to @fk and @LekoArts for lots of prior art, here!
Preview