GithubHelp home page GithubHelp logo

gatsby-universal

CircleCI Greenkeeper badge styled with prettier Netlify Status

An opinionated Gatsby v2 starter with React Context, styled-components, page transitions, scroll events with IntersectionObserver and a focus on accessibility and SEO. Made for state-of-the-art marketing sites.

You can access a demo of this starter online at gatsby-universal.netlify.com.


Features

  • ๐Ÿคฉ Page Transitions, component-based (with no-js support)
  • ๐Ÿ‘ฎโ€โ™‚๏ธ IntersectionObserver, component-based (with polyfill)
  • ๐ŸŒฟ React Context for global UI state, with SSR
  • ๐Ÿ’… styled-components v4
  • ๐Ÿ’ฏ Optimized with Google Lighthouse (including test)
  • ๐Ÿ”ฅ Code Splitting of CSS and JS (component based)
  • ๐Ÿ”ช Inline SVG support
  • โš™๏ธ One config file for site-wide settings
  • ๐Ÿ’™ Most social + meta tags in one component
  • ๐Ÿ–ผ All favicons generated, only one icon file needed
  • ๐ŸŒ Offline support
  • ๐Ÿ“„ Manifest support
  • ๐Ÿ—บ Sitemap support
  • ๐Ÿ“ฑ Generated media queries for easy use
  • ๐Ÿ˜Ž Prettier for code style
  • ๐Ÿ‘ทโ€โ™‚๏ธ CircleCI support
  • ๐Ÿ™ Schema JSONLD
  • ๐Ÿ”Ž size-plugin to keep an eye on your bundle sizes
  • ๐Ÿ‘จโ€๐Ÿซ ESLint (based on eslint-plugin-react)

Do you have suggestions or feedback? Open an issue!

Lighthouse scores (on Netlify)

Lighthouse scores (on Netlify)

Usage

Edit on CodeSandbox Deploy to Netlify

# Installation with `gatsby-cli`
gatsby new my-site https://github.com/fabe/gatsby-universal

# Installation with `git clone`
git clone my-site [email protected]:fabe/gatsby-universal.git
cd my-site
yarn install

# To develop
yarn develop

# To build
yarn build

# To test SSR (for Lighthouse etc.)
yarn ssr

# To format JS (precommit)
yarn format

# To generate favicons (included in `build`)
yarn build:favicons

Configuration

Find the site-wide configuration in site-config.js.

module.exports = {
  siteTitle: `Gatsby Universal`,
  siteTitleShort: `GatsbyU`,
  siteDescription: `An opinionated starter for Gatsby.`,
  siteUrl: `https://gu.fabianschultz.com`,
  themeColor: `#000`,
  backgroundColor: `#fff`,
  pathPrefix: null,
  logo: path.resolve(__dirname, 'src/images/icon.png'),
  social: {
    twitter: `gatsbyjs`,
    fbAppId: `966242223397117`,
  },
};

๐Ÿšจ Don't forget to update your robots.txt inside static/!

Folder structure

โ”œโ”€โ”€ gatsby-browser.js # Specify how Gatsby renders pages in the browser
โ”œโ”€โ”€ gatsby-config.js # Gatsby config, mostly taken from `site-config.js`
โ”œโ”€โ”€ gatsby-node.js # Modify webpack config
โ”œโ”€โ”€ gatsby-ssr.js # Specify how Gatsby builds pages
โ”œโ”€โ”€ site-config.js # Global settings for the whole site, used by multiple scripts
โ”œโ”€โ”€ content # Content & data, in both json and markdown
โ”œโ”€โ”€ src
โ”‚   โ”œโ”€โ”€ components
โ”‚   โ”‚   โ”œโ”€โ”€ head # All meta tags etc.
โ”‚   โ”‚   โ”œโ”€โ”€ io # Intersection Observer component, uses render props
โ”‚   โ”‚   โ”œโ”€โ”€ layout # Layout component
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ layout.css.js # .css.js for component's `styled-components`
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ layout.js
โ”‚   โ”‚   โ””โ”€โ”€ transition # Page Transition component, used by Gatsby APIs
โ”‚   โ”œโ”€โ”€ constants # Site-wide constants (breakpoints, colors, etc.)
โ”‚   โ”œโ”€โ”€ containers # Container components if store is needed
โ”‚   โ”œโ”€โ”€ helpers
โ”‚   โ”‚   โ”œโ”€โ”€ schemaGenerator.js # Generates JSON-LD schema.org snippets
โ”‚   โ”‚   โ””โ”€โ”€ mediaTemplates.js # Creates media queries for styled-components
โ”‚   โ”œโ”€โ”€ images # Images needed by the site/theme (not content)
โ”‚   โ”œโ”€โ”€ pages
โ”‚   โ”œโ”€โ”€ store # Store and provider of a React.createContext instance
โ”‚   โ””โ”€โ”€ global.css.js # Global CSS
โ””โ”€โ”€ scripts
    โ”œโ”€โ”€ lighthouse.test.js # Tests the site specified inside `site-config.js` with Google Lighthouse (WIP)
    โ””โ”€โ”€ favicons.js # Generates favicons and manifest using one png only.

Author

Nithin David Thomas's Projects

bones icon bones

A Mobile-First, Responsive WordPress starter theme based off 320 and Up & HTML5 Boilerplate.

cetdrishti icon cetdrishti

Official Repository of previous year Drishti Websites :)

chatwoot icon chatwoot

Opensource alternative to Intercom, Drift, Zendesk, FreshChat

django icon django

Django fork with support for NoSQL databases

django-mumblr icon django-mumblr

Mumblr is a basic Django tumblelog application that uses MongoDB.

droidsocial icon droidsocial

Open Source Social Network Framework for Androidโ„ข

flask icon flask

A microframework based on Werkzeug, Jinja2 and good intentions

fluentui-system-icons icon fluentui-system-icons

Fluent System Icons are a collection of familiar, friendly and modern icons from Microsoft.

foggy icon foggy

jQuery plugin for blurring page elements

gestalt icon gestalt

A set of React UI components that supports Pinterestโ€™s design language

ghost icon ghost

The platform for professional publishers

gitlabhq icon gitlabhq

GitLab is version control for your server

glide.js icon glide.js

Glide is responsive and touch-friendly jQuery slider. Based on CSS3 transitions with fallback to older broswers. It's simple, lightweight and fast. Designed to slide, no less, no more.

helpy icon helpy

Helpy is a modern, "mobile-first" helpdesk application built in Ruby. Features include multi-lingual knowledgebase, community discussions and private tickets integrated with email.

india icon india

GitHub resources and information for the developer community in India

inuit.css icon inuit.css

inuit.cssโ€”cooler than a polar bearโ€™s toenails

jquery-file-upload icon jquery-file-upload

File Upload widget with multiple file selection, drag&drop support, progress bars and preview images for jQuery. Supports cross-domain, chunked and resumable file uploads and client-side image resizing. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.

jquery-tags-input icon jquery-tags-input

Magically convert a simple text input into a cool tag list with this jQuery plugin.

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.