Giter Club home page Giter Club logo

gatsbyjs-starter-buttercms's Introduction

Gatsby + ButterCMS Starter Project

This Gatsby starter project fully integrates with dynamic sample content from your ButterCMS account, including main menu, pages, blog posts, categories, and tags, and all with a beautiful, custom theme with already-implemented search functionality. All of the included sample content is automatically created in your account dashboard when you sign up for a free trial of ButterCMS.

You can view a live demo hosted on Vercel or on Gatsby Cloud, or you can click a button below to deploy your own copy of our starter project to the provider of your choice.

Deploy with Vercel

Deploy with Gatsby Cloud

Deploy with Heroku

1. Installation

First, clone the repo and install the dependencies by running npm install

git clone https://github.com/ButterCMS/gatsbyjs-starter-buttercms.git
cd gatsbyjs-starter-buttercms
npm install

2. Set API Token

To fetch your ButterCMS content, add your API token as an environment variable.

$ echo 'BUTTER_CMS_API_KEY=<Your API Token>' >> .env

3. Run local server

To view the app in the browser, you'll need to run the local development server:

$ npm run develop

Congratulations! Your starter project is now live at http://localhost:8000/.

4. Deploy With A Click

Deploy your Gatsby app using Vercel, the creators of Next.js, with Gatsby Cloud, or with Heroku. With a single click, you'll create a copy of our starter project in your Git provider account, instantly deploy it, and institute a full content workflow connected to your ButterCMS account. Smooth.

Deploy with Vercel

Deploy with Gatsby Cloud

Deploy with Heroku

โš ๏ธ Don't forget to set the BUTTER_CMS_API_KEY environment variable in Gatsby Cloud.

5. Webhooks

In order for your deployed app to pull in content changes from your ButterCMS account, you'll need to follow your hosting provider's steps for setting up webhooks. The ButterCMS webhook settings are located at https://buttercms.com/webhooks/.

6. Previewing Draft Changes

By default, your starter project is set up to allow previewing of draft changes saved in your ButterCMS.com account. To disable this functionality, set the following value in your .env file: BUTTER_CMS_PREVIEW=false

Note that if you deployed with heroku and you want to use the iframe previewing ability on the ButterCMS.com website, you'll need to include trailing slashes when specifying your URLS in your ButterCMS.com settings.

mydomain.com/blog/<slug>   <-- Won't work for previewing
mydomain.com/blog/<slug>/  <-- Will work for previewing.

gatsbyjs-starter-buttercms's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.