I've got a static site written in Gatsby and Contentful. I want to add to the app AMP Stories. The stories content will be fetched during build from Contentful and out of it I want to generate AMP stories pages.
Problem
AMP Stories needs to have only one direct child of document's body - amp-story tag.
The difference between an AMP webpage and a Web Story built with AMP is the amp-story component. It is the only direct child of the document and must contain the standalone attribute. All Web Story pages, layers, and elements are defined within the tags.
But from the other side Gatsby needs:
Inside your you must have a div with an id of ___gatsby like
Ideas
- I can write the amp page by myself and put it into the
staticfolder, but I want to generate it automatically, and synchronize it with Contentful. - I can use
onPostBuildfromgatsby-nodeAPI to adapt the generated HTML to AMP Story requirements.
Does anyone have any other idea or advice on how to implement AMP Stories in Gatsby?