Best way to setup ghost with Github pages

#1

I’m looking to set up ghost with gh-pages. Many methods online refer setup with buster. I’m having certain issues (like sitemap.xml is not setting up, blog is not being indexed by google). Is there any robust method provided officially by ghost ?

0 Likes

Not being indexed by google
#2

The closest thing that is officially provided by Ghost would be the gatsby-starter-ghost, which uses Gatsby as a static site generator and Ghost as a CMS - you can read about it here: https://docs.ghost.org/api/gatsby/

You could then look at the Gatsby docs to see how to deploy to GitHub pages, there’s an intro to it here: https://www.gatsbyjs.org/docs/how-gatsby-works-with-github-pages/

0 Likes

#3

Thanks, Gatsby seems very promising. I’m quite new, I am following the docs, I’ve added the deploy script to package.json located in current directory. My URL is username.github.io . When I run npm run deploy, I am getting this error
npm ERR! Failed at the ghost@2.18.2 deploy script 'gatsby build && gh-pages -d public -b master'.
I am not sure where to keep the username.github.io directory as well. Do we have to place inside current directory and how do i deal with this error ?
There seems to be an error with this deploy script. I ran the script gatsby build && gh-pages -d public -b master` , and I got the following error :

There was a problem loading the local build command. Gatsby may not be installed in your site's "node_modules" directory. Perhaps you need to run "npm install"? You might need to delete your "package-lock.json" as well.

I installed the gastby-cli and it’s now present in node_modules. How to deal with it ?

0 Likes

#4

It sounds like you didn’t install the dependencies from package.json? I would try running npm install.

As for the username.github.io directory, I’m not sure - I would check out the repo for that https://github.com/tschaub/gh-pages the README or the issue tracker might have something useful!

0 Likes

#5

I installed it using npm install.

0 Likes

#6

I’m not sure what that means, did you run npm install gh-pages or did you run npm install in the gatsby-starter-ghost directory? The latter will read from your package.json and install all the packages listened under the dependencies key

0 Likes

#7

What do I do with the username.github.io ? Do I git clone it or run gastby new username.github.io ?

0 Likes

#8

I installed both dependencies, gh-pages and gastby-cli

0 Likes

#9

Did you clone the gatsby-starter-ghost repo? If so you need to run npm install in there

0 Likes

#13

My blog is not being indexed for a really long time. I think sitemap.xml may be the reason for it (If there are other issues, please let me know). I’m quite new to this. How can i configure it? Google Search console says couldn’t fetch. I’m opening this thread as this is closed. I’m using ghost with Github Pages. My URL is https://prajjwal1.github.io
I’m using Ghost > 1.0

0 Likes

#14

Ghost’s default frontend and the gatsby frontend both have the ability to generate sitemaps. I am not sure what you used to generate a frontend in GitHub, but it seems like it does’t support sitemaps.

0 Likes

#15

I’m using gatsby. Following the instructions from ghost gatsby starter repo. After publishing it still says Error loading stylesheet: An unknown error has occurred (805303f4) https://gatsby.ghost.org/sitemap.xsl

0 Likes

#16

This looks to me as if you didn’t update your siteUrl in the siteConfig.js. Also, are your .ghost.json values correct and point to your Ghost installation?

0 Likes

#17

Thanks, it worked.

0 Likes

#19

I am seeing a difference between how gatsby is creating static site and what ghost local server is showing. Like I’m not able to choose background cover, plus my featured post is showing up like all others, images are not showing up (when deployed to gh-pages). Is that how it is ?

0 Likes

#20

Can I make it look like casper theme as ghost server shows ? This ghost-gatsby theme is quite different.

0 Likes

closed #21

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

0 Likes