GithubHelp home page GithubHelp logo

justinbhalla / gatsby-theme-minimal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from afuh/gatsby-theme-minimal

0.0 0.0 0.0 1.08 MB

A minimalistic gatsby theme

Home Page: https://gatsby-theme-minimal.netlify.com

JavaScript 100.00%

gatsby-theme-minimal's Introduction

Gatsby + Contentful Minimal Theme

site

Demos

Features

  • Contentful as CMS
  • Progressive Web app
  • Offline support
  • RSS feed
  • SEO friendly
  • Tags

Quick start

Installation

You don't need to start a gatsby site, you only need to install a couple of dependencies and create a gatsby-config.js, that's it.

The folder structure of the demo site is just two files!

mkdir my-blog
cd my-blog
npm init
npm i gatsby react react-dom @afuh/gatsby-theme-minimal

Contentful Content Model

Automatically upload a Post content model into your Contentful space:

npm explore @afuh/gatsby-theme-minimal -- npm run setup

You will need to provide a Space ID and a Management token. You can find both keys here: app.contentful.com โ†’ Space Settings โ†’ API keys.

If instead you prefer to do it manually, open your Contentful app and create a Post content model with the following fields:

  • Title: short text.
  • Content: long text, markdown.
  • Image: media.
  • Tags: short text, list.
  • Slug: short text, unique.

It should look like this: contentful

Write some posts

After you create the Post model remember to write some post entries. Let your creative side do the work ;).

Gatsby

Create a gatsby-config.js, add the theme with your settings and you are good to go. If you want to know more about the Contentful options check gatsby-source-contentful

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: "@afuh/gatsby-theme-minimal",
      options: {
        contentful: {
          spaceId: "your Contentful space id",
          accessToken: "your Contentful access token"
        },
        title: "Your title",
        description: "Your description",
        siteUrl: 'https://example.com', // no trailing slash
      }
    }
  ]
}

Start it up!

gatsby develop

Override theme colors.

Gatsby themes provide something called Component Shadowing, which allows us to override or modify components in the theme.

In order to change the color scheme you have to shadowing theme.js. To do this, in your project create a src/@afuh/gatsby-theme-minimal/theme.js folder structure. If you want to know more about Component Shadowing, check here.

You can override the following defaults:

// theme.js
export default {
  primary: "#212129",
  secondary: "#FEFEFE",
  accent: "#78ff78",
  gray: "#9F9FA3",
  softGray: "#9F9FA31a",
  postWidth: 600
}

Favicon and manifest cover

The theme is going to create a theme-content folder with an image inside, this image is used as a favicon and Manifest image. You can replace it and use your own image. Be sure to use the same file name: icon-512x512.png

gatsby-theme-minimal's People

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.