digitalgarden icon indicating copy to clipboard operation
digitalgarden copied to clipboard

How to preview before publishing?

Open dalbasti opened this issue 2 years ago • 4 comments

I wish there is a way to preview my site before deploying it to the internet. Is there a way to build digital garden locally?

dalbasti avatar Jan 09 '23 14:01 dalbasti

There is no built in way to do this. I guess the easiest way to do it would be to create two repos and sites. One for the actual site, and one for previews. And then just change the repository name setting in obsidian depending on if you want to publish it to the preview site or the actual site. Would that work?

oleeskild avatar Jan 09 '23 20:01 oleeskild

Well, since there is no other way, this might be acceptable. Still, I wish it would be possible to find a way around. Thanks.

dalbasti avatar Jan 10 '23 00:01 dalbasti

This might not be the cleanest way to do it but you could make a repository branch including the app.js script given here. This would allow you to run a local version of your digital garden before merging changes to the main branch.

Tomaubier avatar Jan 17 '23 10:01 Tomaubier

I've found a neat way to preview my site before deploying, using Netlify. The doc on Netlify website is a bit unclear, but here is how to do it: First thing to note: every time Netlify builds, it automatically generates a Preview Deploy, with a unique URL, but it also auto deploy to production. What you want is to disable auto deploy, so you can preview the change before manually going live. Steps:

  1. Go to your site config page, choose Deploy tab from the left menu
  2. Click Lock to stop auto publishing (it's unlocked by default so every time you push code to git it will automatically build, then automatically deploy)
  3. On the same page, you will see a list of builds, with the latest on top. When you make change, wait for the build to complete (for digitalgarden site, it can take >30 seconds). Then click on that latest build
  4. In the detailed page of that build, scroll down to Deploy Log, and click Preview, it’s a link to a preview site with a unique URL where you can see the site with latest changes without affecting the production site
  5. If satisfied, go to main Deploy page, and click Publish Deploy

When you don't need to preview Deploy, you can click Unlock to start auto publishing.

johndsmith2024 avatar May 18 '24 10:05 johndsmith2024