Skip to content

cuvh/gatsby-universal

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

71 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

gatsby-universal

CircleCI styled with prettier deploys by netlify

An opinionated starter for using Gatsby v2 with React Context, tag-agnostic styled-components, page transitions, scroll events with IntersectionObserver. Made for state-of-the-art marketing sites.

Features

  • ๐Ÿ’… styled-components, tag agnostic if needed
  • ๐Ÿคฉ Page Transitions, component-based (with no-js support)

    Following Gatsby's switch to @reach/router, page transitions are currently not supported. Follow the progress at #8.

  • ๐Ÿ‘ฎโ€โ™‚๏ธ IntersectionObserver, component-based (with polyfill)
  • ๐ŸŒฟ React Context for global UI state, with SSR
  • ๐Ÿ’ฏ Optimized with Google Lighthouse
  • ๐Ÿ”ฅ Code Splitting of CSS and JS (component based)
  • โš™๏ธ 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

Lighthouse scores (on Netlify)

Lighthouse scores (on Netlify)

Usage

To make sure you have the correct beta versions of Gatsby, please use yarn to install the dependencies.

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

# 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`,
  },
};

Folder structure

โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ gatsby-browser.js
โ”œโ”€โ”€ gatsby-config.js
โ”œโ”€โ”€ gatsby-node.js
โ”œโ”€โ”€ gatsby-ssr.js
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ src
โ”‚   โ”œโ”€โ”€ components
โ”‚   โ”‚   โ”œโ”€โ”€ head # All meta tags etc.
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ head.js
โ”‚   โ”‚   โ”œโ”€โ”€ io # Intersection Observer component, uses render props
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ io.js
โ”‚   โ”‚   โ”œโ”€โ”€ layout # Layout component
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ layout.css.js # .css.js for component's styled-components
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ layout.js
โ”‚   โ”‚   โ””โ”€โ”€ transition # Page Transition component, can be used with any other
โ”‚   โ”‚       โ””โ”€โ”€ transition.js
โ”‚   โ”œโ”€โ”€ constants
โ”‚   โ”œโ”€โ”€ containers
โ”‚   โ”œโ”€โ”€ helpers
โ”‚   โ”‚   โ”œโ”€โ”€ agnosticStyled.js # Tag-agnostic styled-component
โ”‚   โ”‚   โ”œโ”€โ”€ mediaTemplates.js # Creates media queries for styled-components
โ”‚   โ”‚   โ””โ”€โ”€ toFallbackStyleString.js # Creates fallback styles for no-js page transitions
โ”‚   โ”œโ”€โ”€ images
โ”‚   โ”œโ”€โ”€ pages
โ”‚   โ”œโ”€โ”€ reset.css.js # Global CSS
โ”‚   โ””โ”€โ”€ store
โ””โ”€โ”€ yarn.lock

Author

About

๐Ÿ”ฎ An opinionated starter for Gatsby v2.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%