datocms / gatsby-source-datocms

Official GatsbyJS source plugin to pull content from DatoCMS
MIT License
140 stars 50 forks source link

remove drafted content from Gatsby Cloud builds #124

Closed thinkybeast closed 3 years ago

thinkybeast commented 3 years ago

Currently, drafted records in DatoCMS appear in both Gatsby Cloud deploy builds and previews.

To reproduce:

Actual: The drafted record appears as a page in the deploy build and the preview build. Expected: The drafted record only appears in the preview build.

This change checks that this is both a Gatsby Cloud build, and that this is specifically a Preview build (the executing command is gatsby develop.

stefanoverna commented 3 years ago

Nice! Released in v2.5.2, thanks @thinkybeast !