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 Novela skin and functionality. All content is sourced from a headless Ghost CMS.
This starter is being used at Draftbox. Get lightning fast, secure front-end for your WordPress or Ghost blog, in 5 minutes or less, without coding. For our fellow devs, we also provide code export feature.
Play with the Demo to get a first impression.
- Novela theme by Narrative
- SEO optimized
- Fully responsive
- Gatsby images
- Styled 404 page
- RSS Feed
- AMP Pages
- Sitemap
- Contact Form
- Subscribe Form
- Social Sharing
- Google Analytics Integration
- Segment Integration
- Disqus Integration
- Composable and extensible
-
Install this starter by running
gatsby new try-ghost https://github.com/draftbox-co/gatsby-ghost-novela-starter
-
Change directory
cd try-ghost
-
Run
gatsby develop
and visit your site at
http://localhost:8000
.
A quick look at the top-level files and directories you'll see in a Gatsby project.
.
βββ node_modules
βββ static
βββ .gitignore
βββ gatsby-config.js
βββ yarn.lock
βββ package.json
βββ README.md
-
/node_modules
: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed. -
/static
: This directory will contain all of the static files required by theme such asfavicon
,logo
androbot.txt
. -
.gitignore
: This file tells git which files it should not track / not maintain a version history for. -
gatsby-config.js
: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins youβd like to include, etc. (Check out the config docs for more detail). -
yarn.lock
(Seeyarn.lock
below, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. (You wonβt change this file directly). -
package.json
: A manifest file for Node.js projects, which includes things like metadata (the projectβs name, author, etc). This manifest is how npm knows which packages to install for your project. -
README.md
: A text file containing useful reference information about your project.
//siteConfig.js
module.exports = {
siteUrl: "https://ghost-novela-preview.draftbox.co",
postsPerPage: 12,
siteTitleMeta: "Built with Draftbox",
siteDescriptionMeta:
"Lightning fast, secure front-end for your WordPress or Ghost blog, without coding.",
shareImageWidth: 1000,
shareImageHeight: 523,
shortTitle: "Built with Draftbox",
siteIcon: "favicon.png",
backgroundColor: "#e9e9e9",
themeColor: "#15171A",
apiUrl: "https://ghost.theasdfghjkl.com",
header: {
navigation: [
{
label: "Home",
url: "https://ghost-novela-preview.draftbox.co/",
},
{
label: "Contact",
url: "https://ghost-novela-preview.draftbox.co/contact",
},
],
},
footer: {
copyright: "Built with Draftbox",
navigation: [
{
label: "Home",
url: "https://ghost-novela-preview.draftbox.co/",
},
{
label: "Sitemap",
url: "https://ghost-novela-preview.draftbox.co/sitemap.xml",
},
{
label: "RSS",
url: "https://ghost-novela-preview.draftbox.co/rss.xml",
},
{
label: "Contact",
url: "https://ghost-novela-preview.draftbox.co/contact",
},
{
label: "External Link",
url: "https://spectrum.chat/gatsby-js/themes?tab=posts",
},
],
},
subscribeWidget: {
title: "Subscribe to Built with Draftbox",
helpText: "Get the latest posts delivered right to your inbox.",
successMessage: "Thanks for subscribing to Built with Draftbox.",
},
socialLinks: {
twitter: "https://twitter.com/draftboxhq",
facebook: "https://facebook.com/",
instagram: "https://www.instagram.com/",
linkedin: "https://linkedin.com",
github: "https://github.com/draftbox-co",
},
contactWidget: {
title: "Contact Built with Draftbox",
successMessage: "Weβll get in touch with you soon.",
},
};
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.
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"
}
}
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.
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.
- Arun Priyadarshi (@Gunnerforlife) β Draftbox
- Keyur Raval (@thandaanda) β Draftbox
- Shyam Lohar (@shyamlohar) β Draftbox
- Tanmay Desai (@tanmaydesai89) β Draftbox
PRs are welcome! Consider contributing to this project if you are missing feature that is also useful for others.
Theme Ported from Novela
Special Thanks to Ghost
Copyright (c) 2020 Draftbox - Released under the MIT license.