Skip to content
Gatsby Blog built with Markdown and Contentful Api
CSS JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
static
.gitignore
.prettierignore
.prettierrc
LICENSE
README.md
gatsby-config.js
gatsby-node.js
package-lock.json
package.json

README.md

GreatSby

This project is based on one of my Gatsby Repo: "gatsby-markdown-blog".

step-01

  • Install gatsby-source-contentful;
  • Create .env file and add Gatsby Api Keys;
  • Add the plugin inside "gatsby-config" [with options];
  • Add a fake placeholder image inside Contentful Media to avoid GraphQL issues;
  • Set /pages/blog.js to display all blog posts from Contentful;
  • create a query with "allContentfulBlogPost" and render a list of posts;

step-02

  • Create dynamic pages for each post;
  • Inside "gatsby-node" remove onCreateNode [slugs are defined in Contentful] and modify ".createPages" [see file];
  • Modify Blog Template to render a blog post properly;
  • install @contentful/rich-text-react-renderer and use it inside Blog Template;
  • create 'options' to display images and other assets;

step-03

  • Create "404.js";
  • Add "React-Helmet" for setting up head of our pages;
  • Create the Head components and add it to any pages and blog template;
You can’t perform that action at this time.