/next-cms-ghost

Publish flaring fast blogs with Next.js and Ghost CMS

Primary LanguageCSSMIT LicenseMIT

next-cms-ghost

PRs welcome!

A Next.js app for creating blogs from headless content managment systems (CMS).

Features

  • Ghost CMS integration
  • Ghost Casper look & feel
  • SEO optimized
  • Andvanced Routing
  • Featured posts pinned on top
  • Sticky navigation headers
  • Hover on author avatar
  • Fully responsive
  • Made type safe with TypeScript
  • Next.js feature images
  • Sitemap
  • Styled 404 page
  • Dark Mode
  • RSS feed
  • Member Subscriptions

ToDo

  • Commento
  • PrismJS
  • Next.js inline images
  • Table Of Contents
  • Contact Page
  • Pagination
  • Preview Section in Posts
  • Infinite Scroll
  • Preview
  • Incremental Regeneration

Performance

Lighthouse Score

Scores calculated with Lighthouse 6.4.0.

Getting Started

git clone https://github.com/styxlab/next-cms-ghost.git
cd next-cms-ghost
yarn

# Development
yarn dev

# Production
yarn build

Configuration

Please change the siteUrl to your build system in siteConfig.ts:

export const siteUrl = `http://localhost:3000`
//export const siteUrl = `https://your.blog.org

Next.js image optimizations

You must add all domains that you use for insourcing images in the next.config.js file, for example:

module.exports = {
  images: {
    domains: ['images.unsplash.com', 'static.gotsby.org'],
  },
}

Ghost Content API keys

All content is sourced from a Ghost CMS. Choose the method according to your build scenario.

Building locally

Create a new text file .env.local in the project root folder:

CMS_GHOST_API_URL=http://localhost:2368
CMS_GHOST_API_KEY=9fccdb0e4ea5b572e2e5b92942

Building with cloud providers

If you build your project with a cloud provider, the best option is to provide the keys with environment variables:

Key Value (example)
CMS_GHOST_API_URL http://localhost:2368
CMS_GHOST_API_KEY 9fccdb0e4ea5b572e2e5b92942

Ensure headless mode of Ghost CMS

For best SEO results it is strongly recommended to disable the default Ghost Handlebars theme front-end by selecting the Make this site private flag within your Ghost admin settings.

Deploy

Deploy with Vercel

Contributions

PRs are welcome! Consider contributing to this project if you want to make a better web.

Reporting issues

Please report all bugs and issues at next-cms-ghost/issues.

Disclaimer

This project is not affiliated with NextJS or Ghost.

Copyright & License

Copyright (c) 2020 styxlab - Released under the MIT license.