Question about frontend

Hi, i’m installed ghost on local and ghost+gatsby for create react component, so, now i have two website in local… why this?
I need only admin panel and website with gatsby… how i can do this?

So, i have another question, when i edit a content like a post i see the difference only on ghost cms site and not in gatsby… how i can resolve this? The only solution is restart gatsby ?

I’m working with this in local and i would like to merge all into one site

Hi @mantegnous :wave:
When you use a CMS with a Static Site Generator like Gatsby you’re using you’re using it as a “Headless CMS”, meaning it’s completely decoupled from the front-end. Gatsby works as the build tool for your front-end, and receives content from Ghost via it’s API.
Ghost provides this as an option, with the default being it’s own theming layer which uses Handlebars. This is internally, which explains why you’re seeing two sites. There are multiple ways to resolve this, you can turn on Private mode in the Settings tab, and you can redirects in the Labs tab. We have a guide over here in our docs on how to set up redirects so your Ghost internal site redirects to your Gatsby site:
https://ghost.org/docs/api/v3/gatsby/use-cases-pitfalls/#redirecting-to-external-urls

Because Gatsby is a Static Site Generator it needs to regenerate to show new content. This can indeed be done by restarting, but in a production environment you’ll want to use webhooks to let the hosting platform know there is new content and it needs to regenerate the site. You can find out how to do this with the hosting platform Netlify here:

Hope this clears things up :blush:

OK, i know this, but, for example, there are a repo with ghost + only react? so in this case i can use one website with one theme developed in react

This could be a solution for dont use netlify and other stuff??

You could certainly use React within a Ghost theme, within the Handlebars templates. But then you wouldn’t need to use Gatsby :slightly_smiling_face:

There are some example? This could help me, so i can use only ghost + react and no more problems

I did a very quick search online and found this article on adding React to a Ghost theme on DEV:

Maybe a good starting point :slight_smile:

1 Like

Great! I’ll try this, seems a good solution!

PS: i can do this with create-react-app?

I should think so! However I can’t be 100% sure as I have yet to try it with a Ghost theme :blush:

I need only to create a theme, custom component with react and put them on ghost, i’ll try to follow your example

Thttps://dev.to/webeleon/adding-react-to-a-ghost-blog-theme-4ecb unlesses, this create static navbar i cant add route by cms so…