Skip to content

Get fast up and running with a blog boilerplate using static page generator using Gatsby (a blazing-fast static site generator for React) and a CMS with Contentful hosted by Netlify.

License

Notifications You must be signed in to change notification settings

josefnorlin/gatsby-blog-boilerplate

Repository files navigation

gatsby-blog-boilerplate

Get fast up and running with a blog boilerplate using static page generator using Gatsby (a blazing-fast static site generator for React) and a CMS with Contentful hosted by Netlify.

Contribution

This project is based on the contentful-starter project. Read more about it here: https://github.com/contentful-userland/about.

Requirements

Getting started

  1. First make sure you have npm installed on your machine
  1. Install the Gatsby CLI npm install --global gatsby-cli

  2. Create a new Gatsby project using this github rep: gatsby new gatsby-blog-boilerplate https://github.com/josefnorlin/gatsby-blog-boilerplate

  3. Open the folder: cd gatsby-blog-boilerplate

  4. Install it: npm install

  5. Run the setup: npm run setup -- --spaceId tyz8w5nhoib9 --deliveryToken [get-from-contentful] --managementToken [get-from-contentful]

RUN LOCALLY:

  1. Go to your folder (cd [folder location])

  2. (only the first time) npm run setup

  3. Run: npm run dev

DEPLOY:

  1. (only the first time) First make sure you've installed netlifyctl by running:
  • Windows:

    1. Install scoop: Make sure Powershell 3 (or later) and .NET Framework 4.5 (or later) are installed. Then run:

    iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

    1. Use scoop to add netlifyctl as a bucket: scoop bucket add netlifyctl https://github.com/netlify/scoop-netlifyctl

    2. Then install it by: scoop install netlifyctl

  • Mac:

    1. Add netlify tap to brew: brew tap netlify/netlifyctl

    2. Install it running: brew install netlifyctl

  • Linux: Follow the instructions here: https://github.com/netlify/netlifyctl

  1. (only the first time) Go to your folder (cd [folder location])

  2. (only the first time) Login to: netlifyctl login

  3. Build the website by running: npm run build

  4. Deploy it: npm run build && netlifyctl deploy -b public

Set up of the needed content model and create a configuration file

This project comes with a Contentful setup command npm run setup.

Command line dialog of the npm run setup command

This command will ask you for a space ID, and access tokens for the Contentful Management and Delivery API and then import the needed content model into the space you define and write a config file (./contentful.json).

npm run setup automates that for you but if you want to do it yourself rename .contentful.json.sample to .contentful.json and add your configuration in this file.

Crucial Commands

npm run cleanup-repository

Removes all dependencies, scripts and data from the installation script.

Other resources

About

Get fast up and running with a blog boilerplate using static page generator using Gatsby (a blazing-fast static site generator for React) and a CMS with Contentful hosted by Netlify.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published