• Stars
    star
    617
  • Rank 72,284 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🔮 An opinionated Gatsby v2 starter for state-of-the-art marketing sites.

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 [email protected]:fabe/gatsby-universal.git my-site
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

More Repositories

1

gatsby-starter-deck

🗣 Create presentations using Gatsby, React & Markdown.
JavaScript
519
star
2

gatsby-source-figma

🍭 Gatsby plugin for using Figma documents as a data source.
JavaScript
124
star
3

site

🏞 My name dot com.
TypeScript
94
star
4

react-portfolio

⚛️ A workshop for ReactJS.
CSS
36
star
5

t-rex-runner-reason

🦖 The T-Rex Runner Game from Chrome written in Reason
OCaml
15
star
6

gatsby-plugin-drive

🚗 Downloads a Google Drive folder that you can query with gatsby-source-filesystem.
JavaScript
12
star
7

spectacles-cli

🕶 Converts videos into the Snapchat Spectacles style.
JavaScript
11
star
8

gh-lighthouse

📊 Lighthouse scores for GitHub READMEs in SVG.
JavaScript
10
star
9

telegram-chatgpt-worker

🤖 A minimal Telegram bot for ChatGPT
JavaScript
7
star
10

interval

😴 Tracking sleep with a Raspberry Pi and the MPU6050.
CSS
7
star
11

npr

📻 Simple chrome extension to stream NPR.
CSS
6
star
12

www

🤫 A personal, opinionated boilerplate for world wide web applications.
JavaScript
5
star
13

gatsby-react-loadable

Example of using Gatsby v2 with react-loadable.
JavaScript
4
star
14

wepp

🖼 Convert images to WebP on macOS.
JavaScript
4
star
15

hypem-spotify

🔥 Adds popular Hypemachine tracks to a Spotify playlist.
TypeScript
3
star
16

zeit-zu-lueften

Arduino project to measure air quality with the Figaro TGS-2600.
Arduino
2
star
17

mithril-static

🧙 A proof-of-concept of a mithril.js static site generator
JavaScript
2
star
18

fabe.github.io

✨ It's my (old) personal website.
HTML
2
star
19

markdoc-contentful

Adds a Markdoc field to Contentful
JavaScript
2
star
20

rolldown

🎞 Rolldown for iOS. Downloads videos to your camera roll. Simple.
JavaScript
1
star
21

r-random

🤖 Node.js bot that crawls random images from the Reddit API.
JavaScript
1
star
22

women-in-parliaments

Comparing nations based on the share of women and men in their national parliament.
JavaScript
1
star
23

delivery

🚚 Present your designs, clutter-free.
JavaScript
1
star
24

abstract-weather

Visualizing temperature abstractly using p5.js.
JavaScript
1
star
25

test-gatsby-oncreatenode

JavaScript
1
star
26

electron-ffmpeg-starter

📹 Starting point for using using Electron with ffmpeg cross-platform.
JavaScript
1
star
27

sol-lewitt-generator

Sol-LeWitt-Generator made in p5js.
HTML
1
star