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.
- ๐
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
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
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`,
},
};
โโโ 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
- Fabian Schultz (@fschultz_) - Stink Studios