Hi there
Are there any current plugins for SEO / Google AMP / Facebook Instant Articles?
Thanks
There is a Gatsby AMP Starter: https://github.com/chiedo/gatsby-amp-starter-blog
Hope this helps!
@vilav feel free to take a look at all the gatsby starters here, many of which do have SEO support: https://www.gatsbyjs.org/docs/gatsby-starters/. Closing this issue for now but feel free to re-open if your question has not be addressed.
@vilav I have a working solution for AMP that I'm currently writing up. The link @tderflinger is not that flexible though it's a great start. It's also a bit unconventional. For example, you should create your own React component for <amp-img> instead of relying on a script to parse through HTML files and replace <img> with <amp-img>. A component allows you to define fallbacks and set attributes that allow you to leverage AMP goodness.
Hi @misscs! Thanks for your comment! Once you have a working solution, I would also be interested in it!
Kind regards!
@tderflinger I do have one. The bulk of the code is here https://github.com/gatsbyjs/gatsby/issues/3319
All JS files are pulled out of props.headComponents and what's returned is just what's necessary to pass AMP. You'll need to make sure you are using the latest React so that you can set AMP attributes. React < 16 strips all unknown attributes. You'll need to add them as follow:
<html amp="amp">
or
<style amp-custom="amp-custom">
Lastly, we are use gatsby-ssr.js to add style boilerplate that AMP requires.
I'll post the write-up soon!
Most helpful comment
@tderflinger I do have one. The bulk of the code is here https://github.com/gatsbyjs/gatsby/issues/3319
All JS files are pulled out of
props.headComponentsand what's returned is just what's necessary to pass AMP. You'll need to make sure you are using the latest React so that you can set AMP attributes. React < 16 strips all unknown attributes. You'll need to add them as follow:or
Lastly, we are use
gatsby-ssr.jsto add style boilerplate that AMP requires.I'll post the write-up soon!