styxlab / gatsby-theme-try-ghost

A Gatsby theme to build flaring fast blogs from headless Ghost CMS
MIT License
136 stars 56 forks source link

Ghost post is not reflecting when working in dev mode #274

Closed saurabhjain06 closed 3 years ago

saurabhjain06 commented 3 years ago

I am working in localhost environment. Whenever I write a new post, I have to rebuild the Gatsby project by triggering command yarn clean; yarn develop. Is it expected behaviour? Whenever I upload the production build to netlify or any other provider, do I need to rebuild each time? Note:- I am planning to keep my ghost at localhost for production env also.

styxlab commented 3 years ago

Hi @saurabhjain06!

  1. yarn develop should be enough in most cases.
  2. Yes, you need to rebuild every time, but subsequent deploys should be faster with the Netlify caching module.
saurabhjain06 commented 3 years ago

Thanks @styxlab, I am still learning about static sites.. I think thats the concept behind static site is that with every change in content (post, theme, etc.), we need to rebuild and upload it to the servers. No matter dev or prod we have to rebuild. right?

styxlab commented 3 years ago

That's correct, but gatsby/netlify can utilize a cache, so subsequent builds are faster.

saurabhjain06 commented 3 years ago

Thanks @styxlab for this great theme and guidance.. I must say that both Gatsby and next themes are great, though couldn't able to build the nextjs theme in local server due to image optimisation issue with next export (I was planning to build locally and update it manually)..

styxlab commented 3 years ago

For the Next.js project: You can switch off the image optimizations in appConfig.ts. You can build everything local and deploy it with the CLIs from vercel or netlify from your local machine. However, in case of the Next.js project, you must have a Ghost CMS install that is publicly available in order to be able to access the images, because they are not sourced in during the build process. That's different from the Gatsby project where you have the option to that.

saurabhjain06 commented 3 years ago

I think as of now I will keep Gatsby for my blog.. Thanks for your help..