返回排行榜

TryGhost/gatsby-starter-ghost

JavaScriptgatsby.ghost.org

A starter template to build lightning fast websites with Ghost & Gatsby

gatsbygatsby-starternetlifyghoststatic-sitestatic-site-generatorgatsbyjsreact
Star 增长趋势
Star
1.1k
Forks
843
周增长
Issues
15
5001k
2019年1月2021年7月2024年1月2026年7月
制品库npmnpm install gatsby-starter-ghost
README

Deprecated

This project is no longer maintained.


Gatsby Starter Ghost

A starter template to build lightning fast websites with Ghost & Gatsby

Demo: https://gatsby.ghost.org/

 

gatsby-starter-ghost

 

Installing

# With Gatsby CLI
gatsby new gatsby-starter-ghost https://github.com/TryGhost/gatsby-starter-ghost.git
# From Source
git clone https://github.com/TryGhost/gatsby-starter-ghost.git
cd gatsby-starter-ghost

Then install dependencies

yarn

 

Running

Start the development server. You now have a Gatsby site pulling content from headless Ghost.

gatsby develop

By default, the starter will populate content from a default Ghost install located at https://gatsby.ghost.io.

To use your own install, you will need to edit the .ghost.json config file with your credentials. Change the apiUrl value to the URL of your Ghost site. For Ghost(Pro) customers, this is the Ghost URL ending in .ghost.io, and for people using the self-hosted version of Ghost, it's the same URL used to access your site.

Next, update the contentApiKey value to a key associated with the Ghost site. A key can be provided by creating an integration within Ghost Admin. Navigate to Integrations and click "Add new integration". Name the integration appropriately and click create.

Finally, configure your desired URL in siteConfig.js, so links (e. g. canonical links) are generated correctly. You can also update other default values, such as postsPerPage in this file.

To use this starter without issues, your Ghost installation needs to be at least on version 2.10.0.

The default Ghost version that is used for this starter is 5.x. If your Ghost installation is on a lower version, you will need to pass in a version property in your .ghost.json settings:

Ghost >=2.10.0 <5.0.0

{
    "apiUrl": "https://gatsby.ghost.io",
    "contentApiKey": "9cc5c67c358edfdd81455149d0",
    "version": "v4.0"
}

Ghost >=5.0.0

{
    "apiUrl": "https://gatsby.ghost.io",
    "contentApiKey": "9cc5c67c358edfdd81455149d0"
}

 

Deploying with Netlify

The starter contains three config files specifically for deploying with Netlify. A netlify.toml file for build settings, a /static/_headers file with default security headers set for all routes, and /static/_redirects to set Netlify custom domain redirects.

To deploy to your Netlify account, hit the button below.

Deploy to Netlify

Content API Keys are generally not considered to be sensitive information, they exist so that they can be changed in the event of abuse; so most people commit it directly to their .ghost.json config file. If you prefer to keep this information out of your repository you can remove this config and set Netlify ENV variables for production builds instead.

Once deployed, you can set up a Ghost + Netlify Integration to use deploy hooks from Ghost to trigger Netlify rebuilds. That way, any time data changes in Ghost, your site will rebuild on Netlify.

 

Optimising

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.

 

Extra options

# Run a production build, locally
gatsby build

# Serve a production build, locally
gatsby serve

Gatsby develop uses the development config in .ghost.json - while Gatsby build uses the production config.

 

Copyright & License

Copyright (c) 2013-2025 Ghost Foundation - Released under the MIT license.

相关仓库
gatsbyjs/gatsby

React-based framework with performance, scalability, and security built in.

JavaScriptnpmMIT Licensegatsbystatic-site-generator
gatsbyjs.com
56k10.2k
rahuldkjain/github-profile-readme-generator

🚀 Generate GitHub profile README easily with the latest add-ons like visitors count, GitHub stats, etc using minimal UI.

TypeScriptnpmApache License 2.0githubreadme
rahuldkjain.github.io/github-profile-readme-generator
24.4k8.4k
doczjs/docz

✍ It has never been so easy to document your things!

TypeScriptnpmMIT Licensedocsdocumentation
docz.site
23.7k1.5k
pedronauck/docz

✍ It has never been so easy to document your things!

TypeScriptnpmMIT Licensedocsdocumentation
23.6k1.4k
jxnblk/mdx-deck

♠️ React MDX-based presentation decks

JavaScriptnpmMIT Licensereactreactjs
mdx-deck.jxnblk.com
11.5k596
BuilderIO/builder

Visual Development for React, Vue, Svelte, Qwik, and more

TypeScriptnpmMIT Licensereactwebcomponents
builder.io
8.8k1.2k
plasmicapp/plasmic

Visual builder for React. Build apps, websites, and content. Integrate with your codebase.

TypeScriptnpmMIT Licensereactbuilder
plasmic.app
6.9k699
peaceiris/actions-gh-pages

GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly.

TypeScriptnpmMIT Licensegithub-actionsgithub-pages
github.com/marketplace/actions/github-pages-action
5.3k451
jonschlinkert/gray-matter

Smarter YAML front matter parser, used by metalsmith, Gatsby, Netlify, Assemble, mapbox-gl, phenomic, vuejs vitepress, TinaCMS, Shopify Polaris, Ant Design, Astro, hashicorp, garden, slidev, saber, sourcegraph, and many others. Simple to use, and battle tested. Parses YAML by default but can also parse JSON Front Matter, Coffee Front Matter, TOML Front Matter, and has support for custom parsers. Please follow gray-matter's author: https://github.com/jonschlinkert

JavaScriptnpmMIT Licenseyamlfront-matter
github.com/jonschlinkert
4.5k162
hunvreus/pagescms

The simplest CMS you'll ever need. Manage content and media right in your GitHub repository.

TypeScriptnpmMIT License11tyastro
pagescms.org
3.9k509
wp-graphql/wp-graphql

:rocket: GraphQL API for WordPress

PHPPackagistGNU General Public License v3.0graphqlwordpress
wpgraphql.com
3.8k474
visiky/resume

🚀 在线简历生成器

TypeScriptnpmMIT Licenseresume-builderresume
visiky.github.io/resume/
3.1k770