Watch a live product demo 👀 See how Sanity powers richer commerce experiences

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– build remarkable experiences at scale

The Sanity Composable Content Cloud is the modern headless CMS 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 answers

Get more help in the community Slack

TopicCategoriesFeaturedRepliesLast Updated
After adding the subtitle and running this code npm run graphql-deploy It does nothingSep 15, 2020
how to limit a reference to just one entry in Studio reference input side versus the default as-many-entries-as-you-fill-in-an-array...Sep 18, 2020
Is it possible to fetch more than one "_type" using GROQ?Nov 2, 2020
I want to add a view with the Structure builder (S.view.component) where I list similar documents based on the title. What...Sep 23, 2020
Is there a structure builder example where the format of each preview for the document list is modified?Feb 3, 2021
I have an array of references to a country schema type but it always just returns NULL values for meJan 30, 2021
Hi, I need help with a query for getting the url of an image asset. Here is what I've been trying, but I only get the _ref...Dec 1, 2020
Sanity UI looks brilliant :smiley: Is something like the current date picker possible at the moment? I’m not sure if anicon...Dec 21, 2020
Hey everyone. I have been coding and may have potentially accidentally deleted something. Does anyone know how to resolve...Dec 26, 2020
Hello everyone and happy new year :raised_hands::skin-tone-2:, I have a problem with outputting Portable Text :disappointed:...Jan 1, 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