👀 See Sanity in action: Watch product demo now →

Set up Draft Previews with Gatsby Cloud Hosting

3 replies
Last updated: Aug 26, 2020
Hi guys, I am working on one gatsby-sanity-netlify stack at this moment on one of my projects. But, I am having some questions to ask, can anyone suggest, how to implement live web preview in sanity for new blog posts, I know it's working for existing posts or published posts, for which pages are already generated in gatsby, but as a content editor one needs to see live web preview for the unpublished posts as well. If anyone have gone through this in past & have some solutions then kindly help me here..
Aug 26, 2020, 10:35 AM
You'll need to run the live preview server somewhere. The easiest way is to do so in Gatsby Cloud, or you can self host it:
https://sanity-io-land.slack.com/archives/C9YQ161LZ/p1597705361144400
https://www.simeongriggs.dev/roll-your-own-gatsby-live-preview-for-sanity
https://medium.com/the-couch/live-preview-in-gatsby-without-the-cost-21f8ac0337bb
https://www.sanity.io/blog/get-started-with-gatsby-and-structured-content
https://www.phmu.de/blog/real-time-preview-for-gatsby-websites-with-the-sanity-io-headless-cms/ The key here is to set up the plugin to have
overlayDrafts: true
 and provide it a token with read permissions in the preview environment, so that the listeners can access the drafts.
Aug 26, 2020, 11:17 AM
Thanks a lot
user Y
, I will take a look on all the links that you have shared, I really appreciate your quick help & response..
Aug 26, 2020, 11:21 AM
No problem! I'm sure you'd find even more pointers by searching this slack btw! And do join the gatsby channel as well
Aug 26, 2020, 11:32 AM

Sanity.io – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Categorized in

Related topics

Get more help in the community Slack

TopicCategoriesFeaturedRepliesLast Updated
How to deploy Gatsby sites using official Sanity starter templates25Nov 30, 2020
How to generate RSS.xml files from Sanity posts with gatsby-plugin-feed6Jan 12, 2021
How to make Algolia work with Gatsby & Sanity8Jan 7, 2021
How to improve image loading with Gatsby and gatsby-plugin-sanity-image?10Nov 27, 2020
How to Decouple the Kitchen Sink Starter from Netlify8Feb 9, 2021
How to display Sanity images in Gatsby-powered photography sites19Jun 16, 2020
Is it possible to use gatsby-image to render images loaded in Portable Text / Rich Text?8Jan 1, 2021
Deploy a Sanity + Next JS site to Netlify6Feb 9, 2021

Related contributions

Jamstack Explorers
- Made with Sanity

Jamstack Explorers is a free learning platform created by the team at Netlify to chart a course through the amazing offerings in the Jamstack ecosystem

Go to Jamstack Explorers

Occo
- Made with Sanity

Complex product offering with nested product structure and tiered pricing.

Kevin Green
Go to Occo

Figma Config
- Made with Sanity

Website for Config, the global design conference by Figma.

Corey Ward
Go to Figma Config