Code Monkey home page Code Monkey logo

ck-gatsby-blog's Introduction

Ck Gatsby

Ck Gatsby blog

Table of contents

Features

  • Beautiful layout.
  • Dark Mode.
  • Beautiful typography.
  • Code highlighting.
  • Filter by topics. ( upcoming )
  • Search articles. ( upcoming )
  • Pagination support. ( upcoming )
  • Mobile-Support.
  • Contentful CMS support.

Quick Start

Create a Gatsby site

Use the Gatsby CLI to create a new site, specifying the Ck gatsby starter.

# Create a new Gatsby site using the Ck gatsby starter
gatsby new <project-name> https://github.com/Ckbhatia/Ck-gatsby-blog

Start Developing

Navigate into your new site’s directory and start it up.

cd blog
gatsby develop

Open the source code and start editing!

Your site is now running at http://localhost:8000!

Note: You'll also see a second link: http://localhost:8000/___graphql. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial.

Access Locally

$ git clone https://github.com/[GITHUB_USERNAME]/[REPO_NAME].git
$ cd [REPO_NAME]
$ yarn
$ npm run develop

Set-up contentful CMS

It's optional to set-up contentful CMS.

  • Create an account on contentful.com
  • Navigate to content model, click on add content type.
  • Name it anything, for ex: blog.
  • Click on Add field, create fields one by one.

There are seven types of fields required.

Name Field ID Appearance Other
Title title Short Text Entry File
Slug slug Short
Thumbnail thumbnail Media
Topic topic Short Text
Author author Short Text
Published published Date & Time
Body body Rich Text

Note: Field ID is case sensitive.

Config contentful

  • Go to settings of contentful.com and click on API Key.
  • Click on "Example Key 1", you can rename this.
  • Copy Space ID and Content Delivery API - access token.
  • Now, Navigate to your local copy of this repo.
  • Create .env.development and .env.production file.
  • Put these variables inside and save the file.
CONTENTFUL_SPACE_ID=<Paste here your space Id>
CONTENTFUL_ACCESS_TOKEN=<Paste here your delivery API - access token>

Publishing article with contentful

  • Navigate to content on contentful.com
  • Click on Add Blog Post button to create a post.
  • Write your article and fill all the required fields.
  • Publish your blog and deploy or re-deploy your own copy of this repo.

Deploy with Netlify

Click the button below to build and deploy your own copy of the repository:

Deploy to Netlify

Folder Structure

└── Public
└── static
    └── favicon
└── src
    ├── assets
    │   ├── _base
    │   ├── _general
    │   ├── _reset
    │   ├── _vars
    │   └── main
    ├── components
    │   ├── Article_page
    |   |   ├── MainBlog
    |   |   ├── Post
    |   |   ├── Share
    |   |   └── Sidebar
    |   ├── Main_page
    |   |   ├── Article
    |   |   ├── LatestPost
    |   |   ├── MainPage
    |   |   └── Sidebar
    │   ├── Footer
    │   ├── Head
    │   ├── Header
    │   ├── Layout
    │   ├── Loader
    │   ├── Mode
    │   └── Subscribe
    ├── Pages
    │   ├── 404
    │   └── Index
    ├── Posts
    ├── templates
    │   └── blog
    └── Context

License

The MIT License (MIT)

Copyright (c) 2020 Chetan Kumar

ck-gatsby-blog's People

Contributors

ckbhatia avatar

Watchers

James Cloos 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.