Hi, this is my first time working with Ghost and Gatsby. The problem I’m facing is that I can’t access the admin panel. The configuration that I’m using is the Ghost-gatsby-starter from GitHub
The path that where I’m searching is /ghost/settings/general/ which gives me a response of 404. What do I need to change to access the settings? The documentation mentions that I should replace the contentApiKey with my personal credentials to display my own posts which makes sense. However, the credentials are located in the admin panel which I can’t access.
When you setup Gatsby + Ghost, then you probably installed Ghost somewhere (on a Server, locally, Ghost(Pro)). This is also the URL that you setup in your .ghost.json file as apiUrl. You basically just need to take that URL of yours and append /ghost to login to your Ghost installation.
The Gatsby starter by default fetches the content from https://gatsby.ghost.io which is only to show you some example content.
Hi, thanks for the reply. I tried to add the URL as the apiURL but it still doesn’t work. Im using a local server at localhost:8000. What should i use as the contentApiKey?
Your local Ghost installation is usually accessible via http://localhost:2358/ and the Admin at http://localhost:2368/ghost. Those two have nothing to do with Gatsby except that Gatsby is using the Content API to fetch the data from Ghost. This is what you set up in your .ghost.json file then: the information for Gatsby where to find your Ghost installation to fetch the data from.
I’ve been trying to set up Gatsby + Ghost and I think I’ll have to point my domain to Netlify so I don’t get a subdomain.netlify.com. But when doing that I lose access to ghost admin panel.
This is an issue because ghost is on DO and gatsby is on Github + Netlify.
@vikaspotluri123 mentioned it about it here, but is there a guide on how this can be done?
There are no guides/tutorials for this yet, as it’s a pretty fresh territory here.
What Vikas said is absolutely correct. I would reconfigure your current DO Ghost installation to run under a subdomain of the domain you’re planning to use. Here’s a topic on how to do that, but you’ll also find it in the Docs.
This just hit me while trying it out on my local. Wouldn’t implementing this solution mean having my posts in two different locations: https://example.com (running on gatsby) and https://content.example.com (running ghost to access the admin panel)?
Also, I noticed that the routes configuration I setup on ghost don’t apply for the gatsby site. I’ve got a simple routing setup to route my /tag/tag-name to just /tag-name.
routes:
/:
template: homepage
collections:
/:
permalink: /{primary_tag}/{slug}/
template: index
The only possible solution I can think of to achieve this is setting up multiple gatsby sites for each tag, which I think isn’t a very clean implementation. And I’m not sure how the domain configuration would be setup in this case either.
Any other workarounds that you folks can point me towards?