项目作者: anthonyMoreira

项目描述 :
Anthony Moreira's blog
高级语言: JavaScript
项目地址: git://github.com/anthonyMoreira/gatsby-blog.git
创建时间: 2020-01-11T23:00:58Z
项目社区:https://github.com/anthonyMoreira/gatsby-blog

开源协议:MIT License

下载


Anthony Moreira’s blog using gatsby, contentful and netlify for hosting

Features

  • Simple content model and structure. Easy to adjust to your needs.
  • Contentful integration using contentful Sync API
  • Using contentful Delivery API.
  • Responsive/adaptive images via gatsby-image
  • Tags for categories
  • Responsive design
  • Post search (todo)
  • SEO (todo)
  • Comments (todo)

Requirements

Getting started

Install npm and gatsby cli

Get the source code and install dependencies.

  1. $ git clone git@github.com:contentful-userland/gatsby-contentful-starter.git
  2. $ yarn install

Or use the Gatsby CLI.

  1. $ gatsby new contentful-starter https://github.com/contentful-userland/gatsby-contentful-starter

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

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

Command line dialog of the yarn 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).

yarn 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

This project comes with a few handy commands for linting and code fixing. The most important ones are the ones to develop and ship code. You can find the most important commands below.

npm run dev

Run in the project locally.

npm run build

Run a production build into ./public. The result is ready to be put on any static hosting you prefer.

npm run deploy

Run a production build into ./public and publish the site to GitHub pages.

npm run cleanup-repository

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