gatsby-starter-try-ghost
A Gatsby starter for creating blogs from headless Ghost CMS.
Turn your Ghost blog into a lightning fast static website. This Gatsby theme is a front-end replacement of the Ghost Handlebars engine featuring the standard Ghost Casper skin and functionality. All content is sourced from a headless Ghost CMS.
Demo
Play with the Demo to get a first impression.
Features
- Ghost Casper look and feel
- Sticky navigation headers
- Gatsby images :rocket: :new:
- Syntax highlighting with PrismJS :new:
- Rewrite CMS links to relative :new:
- Hover on author avatar
- Secondary navigation
- Styled 404 page
- SEO optimized
- Fully responsive
- Composable and extensible
Getting Started
-
Install this starter by running
gatsby new try-ghost https://github.com/styxlab/gatsby-starter-try-ghost
-
Change directory
cd try-ghost
-
Run
gatsby develop
and visit your site at http://localhost:8000
.
Configure
module.exports = {
siteUrl: `https://your-blog.com`,
postsPerPage: 12,
siteTitleMeta: `Gatsby Starter Ghost CMS`,
siteDescriptionMeta: `Gastby Starter with Ghost CMS and Casper Skin`,
shareImageWidth: 1000,
shareImageHeight: 523,
shortTitle: `Ghost`,
siteIcon: `favicon.png`,
backgroundColor: `#e9e9e9`,
themeColor: `#15171A`,
}
In the configuration shown above, the most important fields to be changed are siteUrl
, siteTitleMeta
and siteDescriptionMeta
. Update at least those to fit your needs.
Ghost Content API keys
All content is sourced from a Ghost CMS. If you don't customize the file .ghost.json
content is fetched from the demo location at https://cms.gotsby.org
. Surely you want to source your own content. Change the keys to match your own Ghost CMS Content API keys:
{
"development": {
"apiUrl": "http://localhost:2368",
"contentApiKey": "9fccdb0e4ea5b572e2e5b92942"
},
"production": {
"apiUrl": "http://localhost:2368",
"contentApiKey": "9fccdb0e4ea5b572e2e5b92942"
}
}
Deploy
gatsby build
After completion of the build process your static site can be found in the public/
folder. Copy those files over to your webserver.
Optimizing
You can disable the default Ghost Handlebars theme front-end by enabling the Make this site private
flag within your Ghost settings. This enables password protection in front of the Ghost install and sets <meta name="robots" content="noindex" />
so your Gatsby front-end becomes the source of truth for SEO.
Copyright & License
Copyright (c) 2020 styxlab - Released under the MIT license.