Skip to content

agility/agility-days-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

68 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Gatsby Gatsby

Gatsby + Agility CMS Starter

This repo is released under the MIT license. code style: prettier

This repo is a great starting point to get a Gatsby project up and running quickly with Agility CMS as the Content Management System.

This site uses the Agility CMS Gatsby Source Plugin and it meant to be used with the Blog Template in Agility CMS

This is currently a work in-progress. Please see Issues for a list of features that need to be implemented.

Table of contents

Getting up and running

Pre-requisite: Install the Gatsby CLI

npm install -g gatsby-cli

Additional information for getting started with Gatsby

Pre-requisite: Get a free Agility CMS account

Navigate to https://account.agilitycms.com/sign-up?product=agility-free.

Fill out the form and ensure you select JavaScript as your Development Stack.

On step 2, give your project a name and ensure to select Blog Template as your template.

Save your Agility CMS credentials

After going through the sign up process, you'll come to your Agility CMS Getting Started screen which has Content Fetch API Details. Save your GUID and then click the Show API Key(s) button to reveal your Live API Key and Preview API Key. Click the Show buttons beside both to unmask the credentials and copy these somewhere temporarily, or refer back to this screen when you begin to Configure your local environment.

Content Fetch API Details

Clone this repo to your local machine

git clone https://github.com/agility/agility-gatsby-starter

Install Node dependencies

With Yarn

cd agility-gatsby-starter
yarn

With NPM

cd agility-gatsby-starter
npm install

Configure your local environment

Rename ./.env.development.example to ./.env.development

cp .env.development.example .env.development

Add your development AGILITY_GUID and AGILITY_API_KEY variable values in .env.development

# Your Instance Id
AGILITY_GUID=

# Your Preview API Key (recommended) - you can get this from the Getting Started Page in Agility CMS. It starts with defaultpreview.
AGILITY_API_KEY=

# If using your Preview API Key, set this to true
AGILITY_API_ISPREVIEW=true

Rename ./.env.production.example to ./.env.production

cp .env.production.example .env.production

Add your production AGILITY_GUID and AGILITY_API_KEY variable values in .env.production

# Your Instance Id
AGILITY_GUID=

# Your Live API Key (recommended) - you can get this from the Getting Started Page in Agility CMS. It starts with defaultlive.
AGILITY_API_KEY=

# Since you won't want to preview here, set this to false
AGILITY_API_ISPREVIEW=false

Start the Gatsby development server

Once the above steps are done, you can launch your local development server:

With Yarn

yarn start

With NPM

npm start

How to build a production version of your project and test it

It's good practice to build a production version and test it locally before publishing it or doing a pull request into master. Here's how to do it:

With Yarn

yarn build
yarn serve

With NPM

npm run build
npm run serve

Deploy

Deploy to Netlify

☝️ Deploy this starter repo in just minutes with Netlify. You'll need to add your Agility CMS AGILITY_GUID, AGILITY_API_KEY, and AGILITY_API_ISPREVIEW variables in Netlify's Site settings > Build & deploy > Environment section.

How to format all project code with Prettier

If you care about code formatting and keeping it consistent across your projects and/or among your team, you can utilize an opinionated code formatter like Prettier. This repo contains a ./.prettierrc file which you can modify to suit your formatting tastes/needs.

Documentation on Prettier Options

With Yarn

yarn format

With NPM

npm run format

Customizing your Agility Gatsby project further

gatsby-config.js

You'll want to take a peek under the hood at some point and take the starter's configuration for Gatsby further. To get a better understanding of the options, please visit GatsbyJS Source Plugin for Agility CMS on GitHub for documentation.

What is Agility CMS? What makes it different?

Agility CMS is a headless Content Management System (CMS) that lets you define your custom content types and relationships. This is called Content Architecture, and you can reuse this content for your websites and apps.

In addition, Agility CMS provides a page routing API, which allows you to offload control of the sitemap to the content editors.

All content is available through the Agility CMS Fetch or Preview API.

Resources

Agility CMS

GatsbyJS

Prettier

Community

Roadmap

See the open issues for a list of proposed features (and known issues).

Code of conduct

See CODE OF CONDUCT for more information.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Thank you to all of you who have contributed to agility-gatsby-starter!

πŸŽ‰πŸ€˜πŸ’–πŸ––

License

Distributed under the MIT License. See LICENSE for more information.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published