├── .gitignore
├── README.md
├── examples
├── blank
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ │ └── posts
│ │ └── hello.mdx
├── conference-styled
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ │ ├── data
│ │ ├── mc.yml
│ │ ├── schedule.yml
│ │ ├── speakers.yml
│ │ ├── sponsors.yml
│ │ └── venue.yml
│ │ ├── gatsby-plugin-theme-ui
│ │ └── index.js
│ │ └── gatsby-theme-conference
│ │ └── components
│ │ ├── banner.js
│ │ └── header.js
├── conference
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ │ └── data
│ │ ├── mc.yml
│ │ ├── schedule.yml
│ │ ├── speakers.yml
│ │ ├── sponsors.yml
│ │ └── venue.yml
├── css
│ ├── content
│ │ └── posts
│ │ │ └── hello.mdx
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ │ └── gatsby-theme-css
│ │ ├── header.module.css
│ │ └── layout.js
├── jxnblk-blog
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ │ └── gatsby-theme-blog
│ │ └── components
│ │ ├── bio-content.js
│ │ └── header.js
├── mono-blog
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ │ └── gatsby-theme-blog
│ │ └── components
│ │ ├── bio-content.js
│ │ └── header.js
├── mono-notes
│ ├── content
│ │ └── notes
│ │ │ ├── getting-started.mdx
│ │ │ └── hello.mdx
│ ├── gatsby-config.js
│ └── package.json
├── swiss-blog
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ │ └── gatsby-theme-blog
│ │ └── components
│ │ ├── bio-content.js
│ │ └── header.js
├── system
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ │ ├── gatsby-theme-system
│ │ └── header.mdx
│ │ ├── layout.js
│ │ └── pages
│ │ └── index.mdx
├── theme-ui-blog
│ ├── content
│ │ └── posts
│ │ │ └── hello.mdx
│ ├── gatsby-config.js
│ └── package.json
├── tomato-blog
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ │ └── gatsby-theme-ui-blog
│ │ └── layout.js
└── www
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ ├── index.js
│ └── pages
│ ├── index.mdx
│ └── notes.mdx
├── lerna.json
├── now.json
├── package.json
├── packages
├── blank
│ ├── README.md
│ ├── gatsby-config.js
│ ├── gatsby-node.js
│ ├── index.js
│ ├── package.json
│ └── src
│ │ ├── post.js
│ │ ├── posts.js
│ │ ├── posts
│ │ └── hello.mdx
│ │ └── templates
│ │ ├── post.js
│ │ └── posts.js
├── blog-demo
│ ├── content
│ │ ├── assets
│ │ │ └── avatar.png
│ │ └── posts
│ │ │ ├── hello-world.mdx
│ │ │ ├── my-second-post.mdx
│ │ │ └── new-beginnings.mdx
│ ├── gatsby-config.js
│ └── package.json
├── brutalist
│ ├── README.md
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ │ └── gatsby-plugin-theme-ui
│ │ └── index.js
├── conference
│ ├── .npmignore
│ ├── README.md
│ ├── gatsby-config.js
│ ├── gatsby-node.js
│ ├── index.js
│ ├── package.json
│ └── src
│ │ ├── components
│ │ ├── background-image.js
│ │ ├── banner.js
│ │ ├── button.js
│ │ ├── card.js
│ │ ├── cta.js
│ │ ├── desktop-only.js
│ │ ├── flex-list.js
│ │ ├── footer.js
│ │ ├── header.js
│ │ ├── icon-link.js
│ │ ├── index.js
│ │ ├── layout.js
│ │ ├── list.js
│ │ ├── mc-card.js
│ │ ├── mcs.js
│ │ ├── nav-link.js
│ │ ├── schedule-item.js
│ │ ├── schedule.js
│ │ ├── section-heading.js
│ │ ├── speaker-card.js
│ │ ├── speakers.js
│ │ ├── sponsors.js
│ │ └── venue.js
│ │ ├── data
│ │ ├── mc.yml
│ │ ├── schedule.yml
│ │ ├── speakers.yml
│ │ ├── sponsors.yml
│ │ └── venue.yml
│ │ ├── gatsby-plugin-theme-ui
│ │ └── index.js
│ │ ├── index.js
│ │ ├── layouts
│ │ ├── index.js
│ │ ├── schedule.js
│ │ └── speakers.js
│ │ ├── pages
│ │ ├── index.js
│ │ ├── schedule.js
│ │ └── speakers.js
│ │ └── use-site-metadata.js
├── css
│ ├── README.md
│ ├── content
│ │ └── posts
│ │ │ └── hello.mdx
│ ├── gatsby-browser.js
│ ├── gatsby-config.js
│ ├── gatsby-ssr.js
│ ├── index.js
│ ├── package.json
│ ├── src
│ │ ├── context.js
│ │ ├── gatsby-theme-blog-core
│ │ │ └── components
│ │ │ │ ├── post.js
│ │ │ │ └── posts.js
│ │ ├── index.js
│ │ ├── layout.js
│ │ ├── layout.module.css
│ │ ├── post.js
│ │ ├── posts.js
│ │ ├── posts.module.css
│ │ ├── root.js
│ │ ├── theme.js
│ │ └── toggle-color-mode.js
│ └── yarn.lock
├── jxnblk
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ │ └── gatsby-plugin-theme-ui
│ │ └── index.js
├── mono
│ ├── README.md
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ │ └── gatsby-plugin-theme-ui
│ │ └── index.js
├── sidebar
│ ├── README.md
│ ├── gatsby-browser.js
│ ├── gatsby-config.js
│ ├── gatsby-ssr.js
│ ├── index.js
│ ├── package.json
│ └── src
│ │ ├── _config.js
│ │ ├── config.js
│ │ ├── container.js
│ │ ├── content.js
│ │ ├── footer.js
│ │ ├── header.js
│ │ ├── hooks.js
│ │ ├── index.js
│ │ ├── layout.js
│ │ ├── main.js
│ │ ├── mobile-only.js
│ │ ├── root.js
│ │ ├── sidebar.js
│ │ └── spacer.js
├── swiss
│ ├── README.md
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ │ └── gatsby-plugin-theme-ui
│ │ └── index.js
├── system
│ ├── README.md
│ ├── gatsby-config.js
│ ├── index.js
│ ├── package.json
│ └── src
│ │ ├── footer.mdx
│ │ ├── gatsby-plugin-theme-ui
│ │ └── index.js
│ │ ├── header.mdx
│ │ └── index.js
├── theme-ui-blog
│ ├── README.md
│ ├── content
│ │ ├── assets
│ │ │ └── avatar.png
│ │ └── posts
│ │ │ └── hello.mdx
│ ├── gatsby-config.js
│ ├── index.js
│ ├── package.json
│ └── src
│ │ ├── gatsby-plugin-theme-ui
│ │ └── index.js
│ │ ├── gatsby-theme-blog-core
│ │ └── components
│ │ │ ├── post.js
│ │ │ └── posts.js
│ │ ├── head.js
│ │ ├── layout.js
│ │ ├── post.js
│ │ └── posts.js
└── tomato
│ ├── README.md
│ ├── gatsby-config.js
│ ├── package.json
│ └── src
│ └── gatsby-plugin-theme-ui
│ └── index.js
└── yarn.lock
/.gitignore:
--------------------------------------------------------------------------------
1 | .cache
2 | public
3 | package-lock.json
4 | _notes.md
5 | Users
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Gatsby Themes
3 |
4 | **WIP/Experimental**
5 | A collection of experimental Gatsby themes. Use at your own risk :ghost:
6 |
7 | https://gatsby-themes.now.sh
8 |
9 | :warning: **This repo is very unstable and likely to change.**
10 |
11 | ## Running the examples locally
12 |
13 | Clone this repo and run `yarn` in the root directory.
14 | From one of the examples in `packages/` run `yarn start` to start the Gatsby development server.
15 |
16 | ## Learn more about Gatsby themes
17 |
18 | - [Gatsby Docs](https://www.gatsbyjs.org/docs/themes/)
19 | - [Introducing Gatsby Themes][]
20 | - [Gatsby Themes: Watch Us Build a Theme Live][livestream]
21 | - [Themes Update: Child Theming and Component Shadowing][update]
22 | - [Chris Biscardi's Gatsby Days Talk](https://www.youtube.com/watch?v=wX84vXBpMR8)
23 |
24 | [introducing gatsby themes]: https://www.gatsbyjs.org/blog/2018-11-11-introducing-gatsby-themes/
25 | [update]: https://www.gatsbyjs.org/blog/2019-01-29-themes-update-child-theming-and-component-shadowing/
26 | [livestream]: https://www.gatsbyjs.org/blog/2019-02-11-gatsby-themes-livestream-and-example/
27 |
28 |
--------------------------------------------------------------------------------
/examples/blank/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | pathPrefix: '/examples/blank',
3 | plugins: [
4 | 'gatsby-theme-blank',
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/examples/blank/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "blank-example",
4 | "version": "1.0.2",
5 | "main": "index.js",
6 | "license": "MIT",
7 | "scripts": {
8 | "clean": "gatsby clean",
9 | "start": "gatsby develop",
10 | "build": "gatsby build",
11 | "now-build": "gatsby build --prefix-paths"
12 | },
13 | "dependencies": {
14 | "gatsby": "^2.13.36"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/examples/blank/src/posts/hello.mdx:
--------------------------------------------------------------------------------
1 |
2 | export const date = '2019-07-23'
3 |
4 | # Hello
5 |
6 | This is an unstyled Gatsby MDX blog theme.
7 |
--------------------------------------------------------------------------------
/examples/conference-styled/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | pathPrefix: '/examples/conference-styled',
3 | siteMetadata: {
4 | title: 'Purple Conf 2019',
5 | description: 'The purplest conference ever',
6 | twitter: 'https://twitter.com/gatsbyjs',
7 | instagram: '',
8 | },
9 | plugins: [
10 | 'gatsby-theme-conference',
11 | {
12 | resolve: 'gatsby-plugin-google-fonts',
13 | options: {
14 | fonts: [
15 | 'poppins\:400,600,900'
16 | ]
17 | }
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/examples/conference-styled/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "conference-example-styled",
4 | "version": "1.0.2",
5 | "scripts": {
6 | "clean": "rm -rf node_modules .cache public",
7 | "start": "gatsby develop",
8 | "build": "gatsby build",
9 | "now-build": "gatsby build --prefix-paths"
10 | },
11 | "dependencies": {
12 | "gatsby": "^2.1.19",
13 | "gatsby-plugin-google-fonts": "^1.0.0",
14 | "gatsby-theme-conference": "^0.1.1",
15 | "react": "^16.8.3",
16 | "react-dom": "^16.8.3"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/examples/conference-styled/src/data/mc.yml:
--------------------------------------------------------------------------------
1 | - id: mc-jay
2 | name: Jay Gatsby
3 | image: https://upload.wikimedia.org/wikipedia/en/4/42/JayGatsby1.jpg
4 | bio: A mysterious millionaire with shady business connections.
5 | company: Gatsby
6 | twitter: gatsbyjs
7 | github: gatsbyjs
8 |
--------------------------------------------------------------------------------
/examples/conference-styled/src/data/schedule.yml:
--------------------------------------------------------------------------------
1 | - date: 2019-04-15 09:00
2 | title: Keynote
3 | speaker: daisy
4 | description: >
5 | Lollipop jelly beans tart biscuit icing croissant. Gummies apple pie candy canes. Candy canes gingerbread candy gummies jelly-o fruitcake. Jelly beans gummi bears caramels oat cake halvah cake gummies. Powder chupa chups jelly cake candy liquorice. Pie sweet roll fruitcake marshmallow chocolate. Sesame snaps biscuit apple pie cupcake cake jujubes icing gummi bears. Donut biscuit soufflé macaroon bear claw halvah toffee macaroon.
6 | - date: 2019-04-15 09:45
7 | title: Coffee Break
8 | description: Mix and mingle with other conference attendees and speakers
9 | - date: 2019-04-15 10:30
10 | title: Candy Canes
11 | speaker: jay
12 | description: >
13 | Candy canes cake pudding. Soufflé cake chocolate bar chocolate cake chocolate cake cheesecake cupcake cupcake muffin. Jujubes liquorice sesame snaps pie. Caramels pudding tiramisu jelly-o dragée pie tootsie roll. Macaroon candy halvah tart. Lollipop croissant pie tootsie roll bear claw bear claw donut ice cream. Gummies chupa chups sugar plum cupcake tiramisu candy canes danish wafer. Bonbon candy powder dessert muffin lemon drops. Bonbon brownie cotton candy topping donut ice cream jujubes soufflé.
14 | - date: 2019-04-16 09:00
15 | title: Pudding
16 | speaker: daisy
17 | description: >
18 | Candy canes cake pudding. Soufflé cake chocolate bar chocolate cake chocolate cake cheesecake cupcake cupcake muffin. Jujubes liquorice sesame snaps pie. Caramels pudding tiramisu jelly-o dragée pie tootsie roll. Macaroon candy halvah tart. Lollipop croissant pie tootsie roll bear claw bear claw donut ice cream. Gummies chupa chups sugar plum cupcake tiramisu candy canes danish wafer. Bonbon candy powder dessert muffin lemon drops. Bonbon brownie cotton candy topping donut ice cream jujubes soufflé.
19 |
--------------------------------------------------------------------------------
/examples/conference-styled/src/data/speakers.yml:
--------------------------------------------------------------------------------
1 | - id: jay
2 | name: Jay Gatsby
3 | image: https://upload.wikimedia.org/wikipedia/en/4/42/JayGatsby1.jpg
4 | bio: A mysterious millionaire
5 | company: Gatsby
6 | twitter: gatsbyjs
7 | github: gatsbyjs
8 | - id: daisy
9 | name: Daisy Buchanan
10 | _image: https://upload.wikimedia.org/wikipedia/en/d/df/Daisy_Buchanan.png
11 | image: https://compote.slate.com/images/589ce9de-a6be-4167-b1ef-59be7f707ed6.jpg
12 | bio: Courteous driver
13 | company: Gatsby
14 | twitter: gatsbyjs
15 | github: gatsbyjs
16 |
--------------------------------------------------------------------------------
/examples/conference-styled/src/data/sponsors.yml:
--------------------------------------------------------------------------------
1 | - id: gatsby
2 | name: Gatsby
3 | url: https://gatsbyjs.org
4 | logo: https://mutability.netlify.com/Gatsby-Logo.svg
5 | tier: platinum
6 |
--------------------------------------------------------------------------------
/examples/conference-styled/src/data/venue.yml:
--------------------------------------------------------------------------------
1 | venue:
2 | title: Grand Theater
3 | address: 1234 Main St
4 | url: http://example.com
5 | description: >
6 | Wafer caramels sweet dessert oat cake cotton candy marshmallow gingerbread. Dragée danish danish icing gummi bears brownie bear claw donut. Muffin marzipan marshmallow lollipop marshmallow cake bonbon brownie.
7 | image: https://lh5.googleusercontent.com/p/AF1QipOb3qewSnTdEdo1d7_ZojPFpDpm3h8i2jPLfNz9=w408-h272-k-no
8 | mapURL: https://www.google.com/maps/place/Empire+State+Building/@40.7484445,-73.9878531,17z/data=!3m1!4b1!4m5!3m4!1s0x89c259a9b3117469:0xd134e199a405a163!8m2!3d40.7484405!4d-73.9856644
9 |
--------------------------------------------------------------------------------
/examples/conference-styled/src/gatsby-plugin-theme-ui/index.js:
--------------------------------------------------------------------------------
1 | import theme from 'gatsby-theme-conference/src/gatsby-plugin-theme-ui'
2 |
3 | export default {
4 | ...theme,
5 | colors: {
6 | ...theme.colors,
7 | primary: 'rebeccapurple',
8 | secondary: '#407',
9 | muted: '#f6eeff'
10 | },
11 | fonts: {
12 | body: 'Poppins, sans-serif',
13 | heading: 'Poppins, sans-serif',
14 | },
15 | fontWeights: {
16 | body: 400,
17 | bold: 600,
18 | heading: 900,
19 | },
20 | styles: {
21 | ...theme.styles,
22 | h1: {
23 | ...theme.styles.h1,
24 | color: 'primary',
25 | },
26 | h2: {
27 | ...theme.styles.h2,
28 | color: 'primary',
29 | },
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/examples/conference-styled/src/gatsby-theme-conference/components/banner.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import {
3 | jsx,
4 | Flex,
5 | Container,
6 | Styled,
7 | } from 'theme-ui'
8 | import {
9 | Button,
10 | } from 'gatsby-theme-conference'
11 |
12 | export default props =>
13 |
18 |
19 |
25 |
26 |
31 |
32 |
33 |
34 | Purple Conf 2019
35 |
36 |
40 | The purplest conference ever.
41 |
42 |
43 | Buy Tickets
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/examples/conference-styled/src/gatsby-theme-conference/components/header.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Link } from 'gatsby'
3 | import { Fragment } from 'react'
4 | import {
5 | jsx,
6 | Styled,
7 | } from 'theme-ui'
8 | import {
9 | Button,
10 | NavLink,
11 | } from 'gatsby-theme-conference'
12 |
13 |
14 | export default props =>
15 |
16 |
24 |
29 |
30 | Purple Conf
31 |
32 |
33 |
34 | Buy Tickets
35 |
36 |
37 |
--------------------------------------------------------------------------------
/examples/conference/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | pathPrefix: '/examples/conference',
3 | plugins: [
4 | 'gatsby-theme-conference'
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/examples/conference/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "conference-example",
4 | "version": "1.0.2",
5 | "scripts": {
6 | "clean": "rm -rf node_modules .cache public",
7 | "start": "gatsby develop",
8 | "build": "gatsby build",
9 | "now-build": "gatsby build --prefix-paths"
10 | },
11 | "dependencies": {
12 | "gatsby": "^2.1.19",
13 | "gatsby-theme-conference": "^0.1.1",
14 | "react": "^16.8.3",
15 | "react-dom": "^16.8.3"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/examples/conference/src/data/mc.yml:
--------------------------------------------------------------------------------
1 | - id: mc-jay
2 | name: Jay Gatsby
3 | image: https://upload.wikimedia.org/wikipedia/en/4/42/JayGatsby1.jpg
4 | bio: A mysterious millionaire with shady business connections.
5 | company: Gatsby
6 | twitter: gatsbyjs
7 | github: gatsbyjs
8 |
--------------------------------------------------------------------------------
/examples/conference/src/data/schedule.yml:
--------------------------------------------------------------------------------
1 | - date: 2019-04-15 09:00
2 | title: Keynote
3 | speaker: daisy
4 | description: >
5 | Lollipop jelly beans tart biscuit icing croissant. Gummies apple pie candy canes. Candy canes gingerbread candy gummies jelly-o fruitcake. Jelly beans gummi bears caramels oat cake halvah cake gummies. Powder chupa chups jelly cake candy liquorice. Pie sweet roll fruitcake marshmallow chocolate. Sesame snaps biscuit apple pie cupcake cake jujubes icing gummi bears. Donut biscuit soufflé macaroon bear claw halvah toffee macaroon.
6 | - date: 2019-04-15 09:45
7 | title: Coffee Break
8 | description: Mix and mingle with other conference attendees and speakers
9 | - date: 2019-04-15 10:30
10 | title: Candy Canes
11 | speaker: jay
12 | description: >
13 | Candy canes cake pudding. Soufflé cake chocolate bar chocolate cake chocolate cake cheesecake cupcake cupcake muffin. Jujubes liquorice sesame snaps pie. Caramels pudding tiramisu jelly-o dragée pie tootsie roll. Macaroon candy halvah tart. Lollipop croissant pie tootsie roll bear claw bear claw donut ice cream. Gummies chupa chups sugar plum cupcake tiramisu candy canes danish wafer. Bonbon candy powder dessert muffin lemon drops. Bonbon brownie cotton candy topping donut ice cream jujubes soufflé.
14 | - date: 2019-04-16 09:00
15 | title: Pudding
16 | speaker: daisy
17 | description: >
18 | Candy canes cake pudding. Soufflé cake chocolate bar chocolate cake chocolate cake cheesecake cupcake cupcake muffin. Jujubes liquorice sesame snaps pie. Caramels pudding tiramisu jelly-o dragée pie tootsie roll. Macaroon candy halvah tart. Lollipop croissant pie tootsie roll bear claw bear claw donut ice cream. Gummies chupa chups sugar plum cupcake tiramisu candy canes danish wafer. Bonbon candy powder dessert muffin lemon drops. Bonbon brownie cotton candy topping donut ice cream jujubes soufflé.
19 |
--------------------------------------------------------------------------------
/examples/conference/src/data/speakers.yml:
--------------------------------------------------------------------------------
1 | - id: jay
2 | name: Jay Gatsby
3 | image: https://upload.wikimedia.org/wikipedia/en/4/42/JayGatsby1.jpg
4 | bio: A mysterious millionaire
5 | company: Gatsby
6 | twitter: gatsbyjs
7 | github: gatsbyjs
8 | - id: daisy
9 | name: Daisy Buchanan
10 | _image: https://upload.wikimedia.org/wikipedia/en/d/df/Daisy_Buchanan.png
11 | image: https://compote.slate.com/images/589ce9de-a6be-4167-b1ef-59be7f707ed6.jpg
12 | bio: Courteous driver
13 | company: Gatsby
14 | twitter: gatsbyjs
15 | github: gatsbyjs
16 |
--------------------------------------------------------------------------------
/examples/conference/src/data/sponsors.yml:
--------------------------------------------------------------------------------
1 | - id: gatsby
2 | name: Gatsby
3 | url: https://gatsbyjs.org
4 | logo: https://mutability.netlify.com/Gatsby-Logo.svg
5 | tier: platinum
6 |
--------------------------------------------------------------------------------
/examples/conference/src/data/venue.yml:
--------------------------------------------------------------------------------
1 | venue:
2 | title: Grand Theater
3 | address: 1234 Main St
4 | url: http://example.com
5 | description: >
6 | Wafer caramels sweet dessert oat cake cotton candy marshmallow gingerbread. Dragée danish danish icing gummi bears brownie bear claw donut. Muffin marzipan marshmallow lollipop marshmallow cake bonbon brownie.
7 | image: https://lh5.googleusercontent.com/p/AF1QipOb3qewSnTdEdo1d7_ZojPFpDpm3h8i2jPLfNz9=w408-h272-k-no
8 | mapURL: https://www.google.com/maps/place/Empire+State+Building/@40.7484445,-73.9878531,17z/data=!3m1!4b1!4m5!3m4!1s0x89c259a9b3117469:0xd134e199a405a163!8m2!3d40.7484405!4d-73.9856644
9 |
--------------------------------------------------------------------------------
/examples/css/content/posts/hello.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Hello
3 | date: 2019-07-23
4 | ---
5 |
6 | This is a Gatsby theme made with Theme UI & CSS modules –
7 | create Theme UI standard themes and use them with CSS custom properties in CSS modules.
8 | This theme also includes support for color modes.
9 |
10 | ## Installation
11 |
12 | ```sh
13 | npm i gatsby-theme-css
14 | ```
15 |
16 | ```js
17 | // gatsby-config.js
18 | module.exports = {
19 | plugins: [
20 | 'gatsby-theme-css',
21 | ]
22 | }
23 | ```
24 |
25 | Add MDX blog posts to `content/posts/`, and use frontmatter for metadata.
26 |
--------------------------------------------------------------------------------
/examples/css/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | pathPrefix: '/examples/css',
3 | plugins: [
4 | 'gatsby-theme-css',
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/examples/css/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "css-example",
4 | "version": "1.0.3",
5 | "main": "index.js",
6 | "license": "MIT",
7 | "scripts": {
8 | "start": "gatsby develop",
9 | "clean": "gatsby clean",
10 | "build": "gatsby build",
11 | "now-build": "gatsby build --prefix-paths"
12 | },
13 | "dependencies": {
14 | "gatsby": "*",
15 | "gatsby-theme-css": "^0.2.1",
16 | "react": "^16.8.6",
17 | "react-dom": "^16.8.6"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/css/src/gatsby-theme-css/header.module.css:
--------------------------------------------------------------------------------
1 | .header {
2 | display: flex;
3 | align-items: center;
4 | }
5 |
6 | .spacer { margin-right: auto }
7 |
--------------------------------------------------------------------------------
/examples/css/src/gatsby-theme-css/layout.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Link } from 'gatsby'
3 | import Layout from 'gatsby-theme-css/src/layout'
4 | import ToggleColorMode from 'gatsby-theme-css/src/toggle-color-mode'
5 | import css from './header.module.css'
6 |
7 | export default props =>
8 |
9 |
14 | {props.children}
15 |
16 |
--------------------------------------------------------------------------------
/examples/jxnblk-blog/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | pathPrefix: '/examples/jxnblk-blog',
3 | plugins: [
4 | 'gatsby-theme-demo',
5 | 'gatsby-theme-jxnblk',
6 | ],
7 | siteMetadata: {
8 | title: 'Gatsby Theme Jxnblk',
9 | description: 'A Theme UI preset theme for Gatsby',
10 | author: 'Brent Jackson',
11 | social: [
12 | {
13 | name: 'twitter',
14 | url: 'https://twitter.com/jxnblk',
15 | },
16 | {
17 | name: 'github',
18 | url: 'https://github.com/jxnblk',
19 | },
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/examples/jxnblk-blog/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "jxnblk-blog",
4 | "version": "1.0.3",
5 | "main": "index.js",
6 | "license": "MIT",
7 | "scripts": {
8 | "start": "gatsby develop",
9 | "clean": "gatsby clean",
10 | "build": "gatsby build",
11 | "logo": "npx capture-website-cli 'https://contrast.now.sh/fff/000?size=96&text=S&radius=32&fontSize=2&baseline=1' --width=96 --height=96 --overwrite content/assets/avatar.png",
12 | "now-build": "gatsby build --prefix-paths"
13 | },
14 | "dependencies": {
15 | "gatsby": "^2.13.36",
16 | "gatsby-theme-demo": "^0.1.2",
17 | "gatsby-theme-jxnblk": "^0.1.1",
18 | "react": "^16.8.6",
19 | "react-dom": "^16.8.6"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/jxnblk-blog/src/gatsby-theme-blog/components/bio-content.js:
--------------------------------------------------------------------------------
1 | export default props => false
2 |
--------------------------------------------------------------------------------
/examples/jxnblk-blog/src/gatsby-theme-blog/components/header.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx, useColorMode } from 'theme-ui'
3 | import { Link } from 'gatsby'
4 |
5 | const modes = [
6 | 'light',
7 | 'dark',
8 | ]
9 |
10 | export default props => {
11 | const [ mode, setMode ] = useColorMode()
12 | const toggleMode = e => {
13 | const i = modes.indexOf(mode)
14 | const n = (i + 1) % modes.length
15 | setMode(modes[n])
16 | }
17 |
18 | return (
19 |
59 | )
60 | }
61 |
--------------------------------------------------------------------------------
/examples/mono-blog/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | pathPrefix: '/examples/mono-blog',
3 | plugins: [
4 | 'gatsby-theme-demo',
5 | 'gatsby-theme-mono',
6 | ],
7 | siteMetadata: {
8 | title: 'Gatsby Theme Mono',
9 | description: 'A Theme UI preset theme for Gatsby',
10 | author: 'Brent Jackson',
11 | social: [
12 | {
13 | name: 'twitter',
14 | url: 'https://twitter.com/jxnblk',
15 | },
16 | {
17 | name: 'github',
18 | url: 'https://github.com/jxnblk',
19 | },
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/examples/mono-blog/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "mono-blog",
4 | "version": "1.0.3",
5 | "main": "index.js",
6 | "license": "MIT",
7 | "scripts": {
8 | "start": "gatsby develop",
9 | "clean": "gatsby clean",
10 | "build": "gatsby build",
11 | "logo": "npx capture-website-cli 'https://contrast.now.sh/fff/000?size=96&text=S&radius=32&fontSize=2&baseline=1' --width=96 --height=96 --overwrite content/assets/avatar.png",
12 | "now-build": "gatsby build --prefix-paths"
13 | },
14 | "dependencies": {
15 | "gatsby": "^2.13.36",
16 | "gatsby-theme-demo": "^0.1.2",
17 | "gatsby-theme-mono": "^0.1.2",
18 | "react": "^16.8.6",
19 | "react-dom": "^16.8.6"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/mono-blog/src/gatsby-theme-blog/components/bio-content.js:
--------------------------------------------------------------------------------
1 | export default props => false
2 |
--------------------------------------------------------------------------------
/examples/mono-blog/src/gatsby-theme-blog/components/header.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx, useColorMode } from 'theme-ui'
3 | import { Link } from 'gatsby'
4 |
5 | const modes = [
6 | 'light',
7 | 'dark',
8 | ]
9 |
10 | export default props => {
11 | const [ mode, setMode ] = useColorMode()
12 | const toggleMode = e => {
13 | const i = modes.indexOf(mode)
14 | const n = (i + 1) % modes.length
15 | setMode(modes[n])
16 | }
17 |
18 | return (
19 |
59 | )
60 | }
61 |
--------------------------------------------------------------------------------
/examples/mono-notes/content/notes/getting-started.mdx:
--------------------------------------------------------------------------------
1 | import Readme from 'gatsby-theme-mono/README.md'
2 |
3 | # Getting Started
4 |
5 | See https://github.com/jxnblk/gatsby-themes/tree/master/packages/mono
6 |
7 |
--------------------------------------------------------------------------------
/examples/mono-notes/content/notes/hello.mdx:
--------------------------------------------------------------------------------
1 |
2 | # Hello
3 |
4 | This is `gatsby-theme-mono` *horizontally* composed with `gatsby-theme-notes`.
5 | The Mono theme is built with [Theme UI][],
6 | and can be used to style other Gatsby themes that use `gatsby-plugin-theme-ui`.
7 |
8 | [theme ui]: https://theme-ui.com
9 |
--------------------------------------------------------------------------------
/examples/mono-notes/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | pathPrefix: '/examples/mono-notes',
3 | plugins: [
4 | 'gatsby-theme-notes',
5 | 'gatsby-theme-mono',
6 | ],
7 | siteMetadata: {
8 | title: 'Gatsby Theme Mono',
9 | description: 'A Theme UI preset theme for Gatsby',
10 | author: 'Brent Jackson',
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/examples/mono-notes/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "mono-notes",
4 | "version": "1.0.2",
5 | "main": "index.js",
6 | "license": "MIT",
7 | "scripts": {
8 | "start": "gatsby develop",
9 | "clean": "gatsby clean",
10 | "build": "gatsby build",
11 | "now-build": "gatsby build --prefix-paths"
12 | },
13 | "dependencies": {
14 | "gatsby": "^2.13.36",
15 | "gatsby-theme-mono": "^0.1.2",
16 | "gatsby-theme-notes": "*",
17 | "react": "^16.8.6",
18 | "react-dom": "^16.8.6"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/examples/swiss-blog/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | pathPrefix: '/examples/swiss-blog',
3 | plugins: [
4 | 'gatsby-theme-demo',
5 | 'gatsby-theme-swiss',
6 | ],
7 | siteMetadata: {
8 | title: 'Gatsby Theme Swiss',
9 | description: 'A Theme UI preset theme for Gatsby',
10 | author: 'Brent Jackson',
11 | social: [
12 | {
13 | name: 'twitter',
14 | url: 'https://twitter.com/jxnblk',
15 | },
16 | {
17 | name: 'github',
18 | url: 'https://github.com/jxnblk',
19 | },
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/examples/swiss-blog/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "swiss-blog",
4 | "version": "1.0.3",
5 | "main": "index.js",
6 | "license": "MIT",
7 | "scripts": {
8 | "start": "gatsby develop",
9 | "clean": "gatsby clean",
10 | "build": "gatsby build",
11 | "logo": "npx capture-website-cli 'https://contrast.now.sh/fff/000?size=96&text=S&radius=32&fontSize=2&baseline=1' --width=96 --height=96 --overwrite content/assets/avatar.png",
12 | "now-build": "gatsby build --prefix-paths"
13 | },
14 | "dependencies": {
15 | "gatsby": "^2.13.36",
16 | "gatsby-theme-demo": "^0.1.2",
17 | "gatsby-theme-swiss": "^0.1.2",
18 | "react": "^16.8.6",
19 | "react-dom": "^16.8.6"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/swiss-blog/src/gatsby-theme-blog/components/bio-content.js:
--------------------------------------------------------------------------------
1 | export default props => false
2 |
--------------------------------------------------------------------------------
/examples/swiss-blog/src/gatsby-theme-blog/components/header.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx, useColorMode } from 'theme-ui'
3 | import { Link } from 'gatsby'
4 |
5 | const modes = [
6 | 'light',
7 | 'dark',
8 | ]
9 |
10 | export default props => {
11 | const [ mode, setMode ] = useColorMode()
12 | const toggleMode = e => {
13 | const i = modes.indexOf(mode)
14 | const n = (i + 1) % modes.length
15 | setMode(modes[n])
16 | }
17 |
18 | return (
19 |
59 | )
60 | }
61 |
--------------------------------------------------------------------------------
/examples/system/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | pathPrefix: '/examples/system',
3 | plugins: [
4 | 'gatsby-theme-system'
5 | ],
6 | siteMetadata: {
7 | title: 'Gatsby Theme System',
8 | description: 'An MDX/Styled System Gatsby theme',
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/examples/system/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "system-example",
4 | "version": "1.0.2",
5 | "scripts": {
6 | "clean": "rm -rf node_modules .cache public",
7 | "start": "gatsby develop",
8 | "build": "gatsby build",
9 | "now-build": "gatsby build --prefix-paths"
10 | },
11 | "dependencies": {
12 | "gatsby": "^2.1.19",
13 | "gatsby-theme-system": "^0.2.1",
14 | "react": "^16.8.3",
15 | "react-dom": "^16.8.3"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/examples/system/src/gatsby-theme-system/header.mdx:
--------------------------------------------------------------------------------
1 |
2 | - Gatsby Theme System Example
3 |
--------------------------------------------------------------------------------
/examples/system/src/layout.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Link } from 'gatsby'
3 | import {
4 | Styled,
5 | css,
6 | Layout,
7 | Header,
8 | Main,
9 | Footer,
10 | Box,
11 | } from 'theme-ui'
12 |
13 | export default props =>
14 |
15 |
16 |
17 | Gatsby Theme System
18 |
19 |
20 |
21 | Home
22 |
23 | Demo
24 |
25 |
26 | {props.children}
27 |
28 |
36 |
37 |
--------------------------------------------------------------------------------
/examples/system/src/pages/index.mdx:
--------------------------------------------------------------------------------
1 | import { Layout } from 'gatsby-theme-system'
2 | import Readme from 'gatsby-theme-system/README.md'
3 |
4 | export default Layout
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/theme-ui-blog/content/posts/hello.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Hello
3 | date: 2019-08-15
4 | ---
5 |
6 | Hello, this is an example site built with `gatsby-theme-ui-blog`.
7 | This theme includes only minimal styles to get started with building a custom blog with Theme UI.
8 |
--------------------------------------------------------------------------------
/examples/theme-ui-blog/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | pathPrefix: '/examples/theme-ui-blog',
3 | plugins: [
4 | 'gatsby-theme-ui-blog',
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/examples/theme-ui-blog/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "theme-ui-blog-example",
4 | "version": "1.0.1",
5 | "license": "MIT",
6 | "scripts": {
7 | "start": "gatsby develop",
8 | "build": "gatsby build --prefix-paths",
9 | "clean": "gatsby clean",
10 | "serve": "gatsby serve"
11 | },
12 | "dependencies": {
13 | "gatsby": "*",
14 | "gatsby-theme-ui-blog": "^1.0.1",
15 | "react": "^16.9.0",
16 | "react-dom": "^16.9.0"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/examples/tomato-blog/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | pathPrefix: '/examples/tomato-blog',
3 | plugins: [
4 | 'gatsby-theme-demo',
5 | 'gatsby-theme-tomato',
6 | ],
7 | siteMetadata: {
8 | title: 'Gatsby Theme Tomato',
9 | description: 'A Theme UI preset theme for Gatsby',
10 | author: 'Tomato',
11 | social: [
12 | {
13 | name: 'twitter',
14 | url: 'https://twitter.com/jxnblk',
15 | },
16 | {
17 | name: 'github',
18 | url: 'https://github.com/jxnblk',
19 | },
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/examples/tomato-blog/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "tomato-blog",
4 | "version": "1.0.3",
5 | "main": "index.js",
6 | "license": "MIT",
7 | "scripts": {
8 | "start": "gatsby develop",
9 | "clean": "gatsby clean",
10 | "build": "gatsby build",
11 | "now-build": "gatsby build --prefix-paths"
12 | },
13 | "dependencies": {
14 | "gatsby": "^2.13.36",
15 | "gatsby-theme-blog": "^1.0.2",
16 | "gatsby-theme-demo": "^0.1.2",
17 | "gatsby-theme-mono": "^0.1.2",
18 | "gatsby-theme-swiss": "^0.1.2",
19 | "gatsby-theme-tomato": "^0.1.2",
20 | "react": "^16.8.6",
21 | "react-dom": "^16.8.6"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/examples/tomato-blog/src/gatsby-theme-ui-blog/layout.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from 'theme-ui'
3 | import { Global } from '@emotion/core'
4 | import { Link } from 'gatsby'
5 |
6 | export default props =>
7 |
13 |
18 |
22 |
29 | gatsby-theme-tomato
30 |
31 |
32 |
33 | {props.children}
34 |
35 |
36 |
--------------------------------------------------------------------------------
/examples/www/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [
3 | 'gatsby-plugin-mdx',
4 | 'gatsby-theme-mono',
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/examples/www/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "www",
4 | "version": "1.0.4",
5 | "scripts": {
6 | "clean": "gatsby clean && rm -rf node_modules",
7 | "start": "gatsby develop",
8 | "build": "gatsby build",
9 | "now-build": "gatsby build"
10 | },
11 | "dependencies": {
12 | "gatsby": "^2.1.19",
13 | "gatsby-plugin-mdx": "^1.0.16",
14 | "gatsby-theme-mono": "^0.1.2",
15 | "react": "^16.8.3",
16 | "react-dom": "^16.8.3"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/examples/www/src/index.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx, Styled } from 'theme-ui'
3 |
4 | export const Layout = props =>
5 |
10 | {props.children}
11 |
12 |
--------------------------------------------------------------------------------
/examples/www/src/pages/index.mdx:
--------------------------------------------------------------------------------
1 | import { Layout } from '..'
2 |
3 | export default Layout
4 |
5 | # Gatsby Themes
6 |
7 | A work-in-progress exploration of Gatsby themes
8 |
9 | https://github.com/jxnblk/gatsby-themes
10 |
11 | ## Examples
12 |
13 | - [Theme UI Blog](/examples/theme-ui-blog)
14 | - [Tomato](/examples/tomato-blog)
15 | - [Swiss](/examples/swiss-blog)
16 | - [Mono](/examples/mono-blog)
17 | - [Mono Notes](/examples/mono-notes)
18 | - [Jxnblk](/examples/jxnblk-blog)
19 | - [CSS](/examples/css)
20 | - [System](/examples/system)
21 | - [Conference](/examples/conference-styled)
22 |
23 | [theme ui]: https://theme-ui.com
24 | [mdx]: https://mdxjs.com
25 | [emotion]: https://emotion.sh
26 | [styled system]: https://styled-system.com
27 |
--------------------------------------------------------------------------------
/examples/www/src/pages/notes.mdx:
--------------------------------------------------------------------------------
1 | import { Layout } from '..'
2 |
3 | export default Layout
4 |
5 | # Notes
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/lerna.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "independent",
3 | "npmClient": "yarn",
4 | "useWorkspaces": true,
5 | "packages": [
6 | "packages/*"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/now.json:
--------------------------------------------------------------------------------
1 |
2 | {
3 | "public": true,
4 | "version": 2,
5 | "name": "gatsby-themes",
6 | "alias": "gatsby-themes.now.sh",
7 | "builds": [
8 | {
9 | "src": "examples/www/package.json",
10 | "use": "@now/static-build",
11 | "config": {
12 | "distDir": "public"
13 | }
14 | },
15 | {
16 | "src": "examples/**/package.json",
17 | "use": "@now/static-build",
18 | "config": {
19 | "distDir": "public"
20 | }
21 | }
22 | ],
23 | "routes": [
24 | { "src": "/(.*)", "dest": "/examples/www/$1" }
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "gatsby-themes",
4 | "description": "A collection of Gatsby themes",
5 | "author": "Brent Jackson ",
6 | "license": "MIT",
7 | "scripts": {
8 | "clean": "npx lerna run clean",
9 | "start:www": "yarn workspace www start",
10 | "start:blank": "yarn workspace blank-example start",
11 | "start:system": "yarn workspace system-example start",
12 | "start:css": "yarn workspace gatsby-theme-css start",
13 | "start:tomato": "yarn workspace tomato-blog start",
14 | "start:conference": "yarn workspace conference-example start",
15 | "start:conf2": "yarn workspace conference-example-styled start"
16 | },
17 | "workspaces": [
18 | "packages/*",
19 | "examples/*"
20 | ],
21 | "devDependencies": {
22 | "lerna": "^3.16.4"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/blank/README.md:
--------------------------------------------------------------------------------
1 |
2 | # gatsby-theme-blank
3 |
4 | **WIP** A bare-bones, unstyled MDX blog theme for Gatsby
5 |
6 | This theme is intended for use as a base (i.e. parent) theme which can be used to create custom blog themes.
7 |
8 | ## Usage
9 |
10 | ```sh
11 | npm i gatsby-theme-blank
12 | ```
13 |
14 | In your own theme's `gatsby-config.js`, add this theme to the `plugins` array.
15 |
16 | ```js
17 | // gatsby-config.js
18 | module.exports = {
19 | plugins: [
20 | 'gatsby-theme-blank',
21 | ]
22 | }
23 | ```
24 |
25 | Add other plugins as needed, and shadow these components to customize the presentation layer:
26 |
27 | - `src/gatsby-theme-blank/posts.js`: root-level index page
28 | - `src/gatsby-theme-blank/post.js`: post detail page
29 |
30 | In the consuming site, add `.mdx` files to the `src/posts/` directory to add blog posts.
31 |
32 | **Notes:**
33 |
34 | - The implementation details in `gatsby-node.js` are likely to change in the near future, but the outward API should stay the same.
35 | - Posts are ordered by an exported `date` value *or* a `date` frontmatter field
36 | - Titles are derived from the first heading found in the MDX document
37 |
38 | This theme does **not**:
39 |
40 | - Include any styling
41 | - Include features like RSS, authors, image processing, etc.
42 | - Include any additional theme options
43 |
--------------------------------------------------------------------------------
/packages/blank/gatsby-config.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 |
3 | module.exports = {
4 | plugins: [
5 | 'gatsby-plugin-mdx',
6 | {
7 | resolve: 'gatsby-source-filesystem',
8 | options: {
9 | name: 'posts',
10 | path: path.resolve('src/posts'),
11 | }
12 | },
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/blank/gatsby-node.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const { createFilePath } = require('gatsby-source-filesystem')
3 | const mkdirp = require('mkdirp')
4 | const get = require('lodash.get')
5 |
6 | exports.onPreBootstrap = ({ store }) => {
7 | const { program } = store.getState()
8 | const dir = path.join(program.directory, `src/posts`)
9 | mkdirp.sync(dir)
10 | }
11 |
12 | const mdxResolverPassthrough = fieldName => async (
13 | source,
14 | args,
15 | context,
16 | info
17 | ) => {
18 | const type = info.schema.getType(`Mdx`)
19 | const mdxNode = context.nodeModel.getNodeById({
20 | id: source.parent,
21 | })
22 | const resolver = type.getFields()[fieldName].resolve
23 | const result = await resolver(mdxNode, args, context, {
24 | fieldName,
25 | })
26 | return result
27 | }
28 |
29 | const resolveTitle = async (...args) => {
30 | const headings = await mdxResolverPassthrough('headings')(...args)
31 | return get(headings, '0.value', '')
32 | }
33 |
34 | exports.sourceNodes = ({ actions, schema }) => {
35 | actions.createTypes(
36 | schema.buildObjectType({
37 | name: 'Post',
38 | fields: {
39 | id: {
40 | type: 'ID!',
41 | },
42 | slug: {
43 | type: 'String!',
44 | },
45 | date: {
46 | type: 'Date',
47 | extensions: {
48 | dateformat: {}
49 | }
50 | },
51 | title: {
52 | type: 'String',
53 | resolve: resolveTitle,
54 | },
55 | body: {
56 | type: 'String!',
57 | resolve: mdxResolverPassthrough('body'),
58 | },
59 | },
60 | interfaces: [ 'Node' ]
61 | })
62 | )
63 | }
64 |
65 | exports.onCreateNode = ({
66 | node,
67 | actions,
68 | getNode,
69 | createNodeId,
70 | createContentDigest,
71 | }) => {
72 | if (node.internal.type !== 'Mdx') return
73 | const parent = getNode(node.parent)
74 | if (parent.sourceInstanceName !== 'posts') return
75 | const child = getNode(node.id)
76 | const slug = createFilePath({ node, getNode })
77 | const title = get(node, 'headings[1].value', '')
78 | const date = get(node, 'exports.date',
79 | get(node, 'frontmatter.date')
80 | )
81 |
82 | actions.createNode({
83 | title,
84 | date,
85 | slug,
86 | id: createNodeId(`${node.id} >>> Post`),
87 | parent: node.id,
88 | children: [],
89 | internal: {
90 | type: 'Post',
91 | contentDigest: createContentDigest({
92 | slug,
93 | date,
94 | body: node.rawBody,
95 | }),
96 | content: node.rawBody,
97 | description: 'Blog Posts',
98 | },
99 | })
100 |
101 | actions.createParentChildLink({
102 | parent,
103 | child: node,
104 | })
105 | }
106 |
107 |
108 |
109 | exports.createPages = async ({
110 | graphql,
111 | actions,
112 | }) => {
113 |
114 | const result = await graphql(`
115 | {
116 | allPost(
117 | sort: {
118 | fields: date,
119 | order: DESC
120 | }
121 | ) {
122 | edges {
123 | node {
124 | id
125 | slug
126 | date
127 | title
128 | }
129 | }
130 | }
131 | }
132 | `)
133 | if (result.errors) {
134 | console.log(result.errors)
135 | return
136 | }
137 | const posts = result.data.allPost.edges.map(edge => edge.node)
138 |
139 | posts.forEach(post => {
140 | actions.createPage({
141 | path: post.slug,
142 | component: require.resolve('./src/templates/post.js'),
143 | context: {
144 | id: post.id,
145 | },
146 | })
147 | })
148 |
149 | const filtered = await graphql(`
150 | {
151 | allPost(
152 | sort: { fields: date, order: DESC }
153 | limit: 1000
154 | ) {
155 | edges {
156 | node {
157 | id
158 | slug
159 | }
160 | }
161 | }
162 | }
163 | `)
164 | if (filtered.errors) {
165 | console.log(filtered.errors)
166 | return
167 | }
168 | const index = filtered.data.allPost.edges.map(edge => edge.node)
169 | const limit = 16
170 | const length = Math.ceil(index.length / limit)
171 |
172 | Array.from({ length }).forEach((_, i) => {
173 | const previousIndex = i
174 | const nextIndex = i + 2
175 | const previous = (i > 0) ? (
176 | previousIndex === 1
177 | ? '/'
178 | : '/' + previousIndex + ''
179 | ) : ''
180 |
181 | const next = nextIndex <= length ? '/' + nextIndex : ''
182 | actions.createPage({
183 | path: i === 0 ? '/' : '/' + (i + 1),
184 | component: require.resolve('./src/templates/posts.js'),
185 | context: {
186 | previous,
187 | next,
188 | limit,
189 | skip: i * limit,
190 | },
191 | })
192 | })
193 | }
194 |
--------------------------------------------------------------------------------
/packages/blank/index.js:
--------------------------------------------------------------------------------
1 | // noop
2 |
--------------------------------------------------------------------------------
/packages/blank/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gatsby-theme-blank",
3 | "version": "0.1.1",
4 | "description": "A bare-bones, unstyled MDX blog theme for Gatsby",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "gatsby develop"
8 | },
9 | "keywords": [
10 | "gatsby",
11 | "gatsby-plugin",
12 | "gatsby-theme",
13 | "blog",
14 | "mdx"
15 | ],
16 | "author": "Brent Jackson",
17 | "license": "MIT",
18 | "peerDependencies": {
19 | "gatsby": "^2.13.23",
20 | "react": "^16.8.6",
21 | "react-dom": "^16.8.6"
22 | },
23 | "devDependencies": {
24 | "gatsby": "^2.13.23",
25 | "react": "^16.8.6",
26 | "react-dom": "^16.8.6"
27 | },
28 | "dependencies": {
29 | "@mdx-js/mdx": "^1.1.0",
30 | "@mdx-js/react": "^1.0.27",
31 | "gatsby-plugin-mdx": "^1.0.13",
32 | "gatsby-source-filesystem": "^2.1.5",
33 | "lodash.get": "^4.4.2",
34 | "mkdirp": "^1.0.3"
35 | },
36 | "repository": "jxnblk/gatsby-themes"
37 | }
38 |
--------------------------------------------------------------------------------
/packages/blank/src/post.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | export default ({
4 | children,
5 | ...props
6 | }) =>
7 |
13 |
--------------------------------------------------------------------------------
/packages/blank/src/posts.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Link } from 'gatsby'
3 |
4 | export default props =>
5 |
6 |
7 | {props.posts.map(post => (
8 |
9 |
10 | {post.title || post.slug}
11 |
12 |
13 | ))}
14 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/packages/blank/src/posts/hello.mdx:
--------------------------------------------------------------------------------
1 |
2 | export const date = '2019-07-15'
3 |
4 | # Hello World
5 |
--------------------------------------------------------------------------------
/packages/blank/src/templates/post.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { graphql } from 'gatsby'
3 | import { MDXRenderer } from 'gatsby-plugin-mdx'
4 | import Post from '../post'
5 |
6 | export default props => {
7 | const { post } = props.data
8 | const children =
9 |
10 | return (
11 |
16 | )
17 | }
18 |
19 | export const query = graphql`
20 | query ($id: String!) {
21 | post(id: { eq: $id }) {
22 | id
23 | date
24 | title
25 | body
26 | }
27 | }
28 | `
29 |
--------------------------------------------------------------------------------
/packages/blank/src/templates/posts.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { graphql } from 'gatsby'
3 | import Posts from '../posts'
4 |
5 | export default props => {
6 | const posts = props.data.posts.edges
7 | .map(edge => edge.node)
8 |
9 | return (
10 |
14 | )
15 | }
16 |
17 | export const query = graphql`
18 | query ($skip: Int!, $limit: Int!) {
19 | posts: allPost(
20 | sort: {
21 | fields: date,
22 | order: DESC
23 | }
24 | limit: $limit
25 | skip: $skip
26 | ) {
27 | edges {
28 | node {
29 | id
30 | slug
31 | date
32 | title
33 | }
34 | }
35 | }
36 | }
37 | `
38 |
--------------------------------------------------------------------------------
/packages/blog-demo/content/assets/avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jxnblk/gatsby-themes/ea0e19cfeef7fba0d112ffe7e78c94137f50a6dc/packages/blog-demo/content/assets/avatar.png
--------------------------------------------------------------------------------
/packages/blog-demo/content/posts/hello-world.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Hello, World!
3 | date: 2019-07-26
4 | ---
5 |
6 | This is demo content for `gatsby-theme-blog`.
7 | You can install this theme as a replacement for `gatsby-theme-blog` but with some default content included for development.
8 |
--------------------------------------------------------------------------------
/packages/blog-demo/content/posts/my-second-post.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: My Second Post!
3 | date: 2019-05-15
4 | ---
5 |
6 | Wow! I love blogging so much already.
7 |
8 | Did you know that "despite its name, salted duck eggs can also be made from chicken eggs, though the taste and texture will be somewhat different, and the egg yolk will be less rich."? ([Wikipedia Link](http://en.wikipedia.org/wiki/Salted_duck_egg))
9 |
10 | Yeah, I didn't either.
11 |
12 | 
13 |
--------------------------------------------------------------------------------
/packages/blog-demo/content/posts/new-beginnings.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: New Beginnings
3 | date: 2019-05-29
4 | ---
5 |
6 | Far far away, behind the word mountains, far from the countries Vokalia and
7 | Consonantia, there live the blind texts. Separated they live in Bookmarksgrove
8 | right at the coast of the Semantics, a large language ocean. A small river named
9 | Duden flows by their place and supplies it with the necessary regelialia.
10 |
11 | ## On deer horse aboard tritely yikes and much
12 |
13 | The Big Oxmox advised her not to do so, because there were thousands of bad
14 | Commas, wild Question Marks and devious Semikoli, but the Little Blind Text
15 | didn’t listen. She packed her seven versalia, put her initial into the belt and
16 | made herself on the way.
17 |
18 | - This however showed weasel
19 | - Well uncritical so misled
20 | - this is very interesting
21 | - Goodness much until that fluid owl
22 |
23 | When she reached the first hills of the **Italic Mountains**, she had a last
24 | view back on the skyline of her hometown _Bookmarksgrove_, the headline of
25 | [Alphabet Village](http://google.com) and the subline of her own road, the Line
26 | Lane. Pityful a rethoric question ran over her cheek, then she continued her
27 | way. On her way she met a copy.
28 |
29 | ### Overlaid the jeepers uselessly much excluding
30 |
31 | But nothing the copy said could convince her and so it didn’t take long until a
32 | few insidious Copy Writers ambushed her, made her drunk with
33 | [Longe and Parole](http://google.com) and dragged her into their agency, where
34 | they abused her for their projects again and again. And if she hasn’t been
35 | rewritten, then they are still using her.
36 |
37 | > Far far away, behind the word mountains, far from the countries Vokalia and
38 | > Consonantia, there live the blind texts. Separated they live in Bookmarksgrove
39 | > right at the coast of the Semantics, a large language ocean.
40 |
41 | It is a paradisematic country, in which roasted parts of sentences fly into your
42 | mouth. Even the all-powerful Pointing has no control about the blind texts it is
43 | an almost unorthographic life One day however a small line of blind text by the
44 | name of Lorem Ipsum decided to leave for the far World of Grammar.
45 |
46 | ### According a funnily until pre-set or arrogant well cheerful
47 |
48 | The Big Oxmox advised her not to do so, because there were thousands of bad
49 | Commas, wild Question Marks and devious Semikoli, but the Little Blind Text
50 | didn’t listen. She packed her seven versalia, put her initial into the belt and
51 | made herself on the way.
52 |
53 | 1. So baboon this
54 | 2. Mounted militant weasel gregariously admonishingly straightly hey
55 | 3. Dear foresaw hungry and much some overhung
56 | 4. Rash opossum less because less some amid besides yikes jeepers frenetic
57 | impassive fruitlessly shut
58 |
59 | When she reached the first hills of the Italic Mountains, she had a last view
60 | back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet
61 | Village and the subline of her own road, the Line Lane. Pityful a rethoric
62 | question ran over her cheek, then she continued her way. On her way she met a
63 | copy.
64 |
65 | > The copy warned the Little Blind Text, that where it came from it would have
66 | > been rewritten a thousand times and everything that was left from its origin
67 | > would be the word "and" and the Little Blind Text should turn around and
68 | > return to its own, safe country.
69 |
70 | But nothing the copy said could convince her and so it didn’t take long until a
71 | few insidious Copy Writers ambushed her, made her drunk with Longe and Parole
72 | and dragged her into their agency, where they abused her for their projects
73 | again and again. And if she hasn’t been rewritten, then they are still using
74 | her. Far far away, behind the word mountains, far from the countries Vokalia and
75 | Consonantia, there live the blind texts.
76 |
77 | #### Silent delightfully including because before one up barring chameleon
78 |
79 | Separated they live in Bookmarksgrove right at the coast of the Semantics, a
80 | large language ocean. A small river named Duden flows by their place and
81 | supplies it with the necessary regelialia. It is a paradisematic country, in
82 | which roasted parts of sentences fly into your mouth.
83 |
84 | Even the all-powerful Pointing has no control about the blind texts it is an
85 | almost unorthographic life One day however a small line of blind text by the
86 | name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox
87 | advised her not to do so, because there were thousands of bad Commas, wild
88 | Question Marks and devious Semikoli, but the Little Blind Text didn’t listen.
89 |
90 | ##### Wherever far wow thus a squirrel raccoon jeez jaguar this from along
91 |
92 | She packed her seven versalia, put her initial into the belt and made herself on
93 | the way. When she reached the first hills of the Italic Mountains, she had a
94 | last view back on the skyline of her hometown Bookmarksgrove, the headline of
95 | Alphabet Village and the subline of her own road, the Line Lane. Pityful a
96 | rethoric question ran over her cheek, then she continued her way. On her way she
97 | met a copy.
98 |
99 | ###### Slapped cozy a that lightheartedly and far
100 |
101 | The copy warned the Little Blind Text, that where it came from it would have
102 | been rewritten a thousand times and everything that was left from its origin
103 | would be the word "and" and the Little Blind Text should turn around and return
104 | to its own, safe country. But nothing the copy said could convince her and so it
105 | didn’t take long until a few insidious Copy Writers ambushed her, made her drunk
106 | with Longe and Parole and dragged her into their agency, where they abused her
107 | for their projects again and again.
108 |
--------------------------------------------------------------------------------
/packages/blog-demo/gatsby-config.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 |
3 | module.exports = {
4 | plugins: [
5 | {
6 | resolve: 'gatsby-theme-ui-blog',
7 | // resolve: 'gatsby-theme-blog',
8 | options: {
9 | // absolute dirnames are created in the site
10 | contentPath: path.resolve(
11 | path.join(__dirname, 'content/posts')
12 | ),
13 | assetPath: path.resolve(
14 | path.join(__dirname, 'content/assets')
15 | ),
16 | }
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/blog-demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gatsby-theme-demo",
3 | "version": "0.1.2",
4 | "main": "gatsby-config.js",
5 | "license": "MIT",
6 | "dependencies": {
7 | "gatsby-theme-ui-blog": "^1.0.1"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/brutalist/README.md:
--------------------------------------------------------------------------------
1 |
2 | # gatsby-theme-brutalist
3 |
4 | A [Theme UI][] preset theme for [Gatsby][]
5 |
6 | ```sh
7 | npm i gatsby-theme-brutalist
8 | ```
9 |
10 | ## Usage
11 |
12 | This theme is built with composition in mind and can be used as the basis for a custom theme or to adjust the styles in other themes.
13 |
14 | ### Composed with other themes
15 |
16 | ```js
17 | // gatsby-config.js
18 | module.exports = {
19 | plugins: [
20 | 'gatsby-theme-blog',
21 | 'gatsby-theme-brutalist',
22 | ]
23 | }
24 | ```
25 |
26 | ```js
27 | // gatsby-config.js
28 | module.exports = {
29 | plugins: [
30 | 'gatsby-theme-notes',
31 | 'gatsby-theme-brutalist',
32 | ]
33 | }
34 | ```
35 |
36 | ### As a base theme
37 |
38 | The styles in this theme can be used as a starting point for custom themes.
39 |
40 | ```js
41 | // gatsby-config.js
42 | module.exports = {
43 | plugins: [
44 | 'gatsby-theme-brutalist',
45 | 'gatsby-plugin-theme-ui',
46 | ]
47 | }
48 | ```
49 |
50 | ```js
51 | // src/gatsby-plugin-theme-ui/index.js
52 | import baseTheme from 'gatsby-theme-brutalist'
53 |
54 | export default {
55 | ...baseTheme,
56 | // add custom styles to override the base theme
57 | }
58 | ```
59 |
60 | See the [Theme UI][] docs for more info on how to use the styles in your custom theme.
61 |
62 | MIT License
63 |
64 | [gatsby]: https://gatsbyjs.org
65 | [theme ui]: https://theme-ui.com
66 |
--------------------------------------------------------------------------------
/packages/brutalist/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [
3 | 'gatsby-plugin-theme-ui',
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/packages/brutalist/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gatsby-theme-brutalist",
3 | "version": "0.1.2",
4 | "main": "gatsby-config.js",
5 | "license": "MIT",
6 | "peerDependencies": {
7 | "gatsby": "^2.13.36",
8 | "react": "^16.8.6",
9 | "react-dom": "^16.8.6"
10 | },
11 | "dependencies": {
12 | "@emotion/core": "^10.0.14",
13 | "@mdx-js/react": "^1.0.27",
14 | "gatsby-plugin-theme-ui": "^0.2.18",
15 | "theme-ui": "^0.2.18"
16 | },
17 | "repository": "jxnblk/gatsby-themes",
18 | "keywords": [
19 | "gatsby",
20 | "gatsby-theme",
21 | "gatsby-plugin",
22 | "blog",
23 | "mdx",
24 | "theme-ui"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/packages/brutalist/src/gatsby-plugin-theme-ui/index.js:
--------------------------------------------------------------------------------
1 | export default {
2 | initialColorMode: 'light',
3 | colors: {
4 | text: '#000',
5 | background: '#fff',
6 | primary: '#00e',
7 | secondary: '#551a8b',
8 | muted: '#f6f6f9',
9 | modes: {
10 | dark: {
11 | text: '#fff',
12 | background: '#353944',
13 | primary: '#3cf',
14 | secondary: '#39c',
15 | muted: '#2d313a',
16 | }
17 | }
18 | },
19 | fonts: {
20 | heading: 'Georgia, serif',
21 | body: 'Verdana, sans-serif',
22 | monospace: 'monospace',
23 | },
24 | lineHeights: {
25 | body: 1.5,
26 | heading: 1.5,
27 | },
28 | fontWeights: {
29 | body: 400,
30 | heading: 700,
31 | bold: 700,
32 | },
33 | sizes: {
34 | container: 768,
35 | },
36 | type: {
37 | heading: {
38 | fontFamily: 'heading',
39 | fontWeight: 'heading',
40 | lineHeight: 'heading',
41 | },
42 | mono: {
43 | fontFamily: 'monospace',
44 | },
45 | },
46 | styles: {
47 | root: {
48 | fontFamily: 'body',
49 | fontWeight: 'body',
50 | lineHeight: 'body',
51 | },
52 | a: {
53 | color: 'primary',
54 | ':hover,:focus': {
55 | color: 'secondary',
56 | },
57 | },
58 | h1: {
59 | variant: 'type.heading',
60 | },
61 | h2: {
62 | variant: 'type.heading',
63 | },
64 | h3: {
65 | variant: 'type.heading',
66 | },
67 | h4: {
68 | variant: 'type.heading',
69 | },
70 | h5: {
71 | variant: 'type.heading',
72 | },
73 | h6: {
74 | variant: 'type.heading',
75 | },
76 | pre: {
77 | variant: 'type.mono',
78 | overflow: 'auto',
79 | fontSize: 1,
80 | color: 'secondary',
81 | },
82 | code: {
83 | variant: 'type.mono',
84 | },
85 | inlineCode: {
86 | variant: 'type.mono',
87 | color: 'secondary',
88 | },
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/packages/conference/.npmignore:
--------------------------------------------------------------------------------
1 | public
2 | .cache
3 |
--------------------------------------------------------------------------------
/packages/conference/README.md:
--------------------------------------------------------------------------------
1 |
2 | # gatsby-theme-conference
3 |
4 |
--------------------------------------------------------------------------------
/packages/conference/gatsby-config.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 |
3 | module.exports = {
4 | siteMetadata: {
5 | title: 'Conference Theme',
6 | description: 'A Gatsby theme for building conference sites',
7 | twitter: 'https://twitter.com/gatsbyjs',
8 | instagram: 'https://twitter.com/gatsbyjs',
9 | },
10 | mapping: {
11 | 'ScheduleYaml.speaker': `SpeakersYaml`,
12 | },
13 | plugins: [
14 | 'gatsby-plugin-theme-ui',
15 | {
16 | resolve: 'gatsby-source-filesystem',
17 | options: {
18 | path: 'src/data',
19 | name: 'data'
20 | }
21 | },
22 | 'gatsby-transformer-yaml',
23 | {
24 | resolve: 'gatsby-plugin-page-creator',
25 | options: {
26 | path: path.join(__dirname, 'src/pages'),
27 | }
28 | },
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/packages/conference/gatsby-node.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs-extra')
2 | const path = require('path')
3 | const mkdirp = require('mkdirp')
4 | const Debug = require('debug')
5 | const pkg = require('./package.json')
6 |
7 | const debug = Debug(pkg.name)
8 |
9 | exports.onPreBootstrap = ({ store }) => {
10 | const { program } = store.getState()
11 |
12 | const dir = path.join(program.directory, `src/data`)
13 |
14 | debug(`Initializing ${dir} directory`)
15 | mkdirp.sync(dir)
16 |
17 | // todo: find a better way to bootstrap site data
18 | const src = path.join(__dirname, 'src/data')
19 | const dest = path.resolve('src/data')
20 | const files = fs.readdirSync(dest)
21 | if (!files.length && src !== dest) {
22 | fs.copySync(src, dest)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/conference/index.js:
--------------------------------------------------------------------------------
1 | export * from './src'
2 |
--------------------------------------------------------------------------------
/packages/conference/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gatsby-theme-conference",
3 | "description": "A Gatsby theme for creating conference sites",
4 | "version": "0.1.1",
5 | "main": "index.js",
6 | "author": "Brent Jackson ",
7 | "license": "MIT",
8 | "scripts": {
9 | "clean": "rm -rf node_modules",
10 | "start": "gatsby develop"
11 | },
12 | "dependencies": {
13 | "@emotion/core": "^10.0.10",
14 | "debug": "^4.1.1",
15 | "fs-extra": "^8.0.1",
16 | "gatsby-plugin-page-creator": "^2.0.12",
17 | "gatsby-plugin-theme-ui": "^0.2.18",
18 | "gatsby-source-filesystem": "^2.0.29",
19 | "gatsby-transformer-yaml": "^2.1.11",
20 | "lodash.groupby": "^4.6.0",
21 | "mkdirp": "^1.0.3",
22 | "react-feather": "^2.0.3",
23 | "theme-ui": "^0.2.16"
24 | },
25 | "peerDependencies": {
26 | "gatsby": "^2.1.18",
27 | "react": "^16.8.3",
28 | "react-dom": "^16.8.3"
29 | },
30 | "devDependencies": {
31 | "gatsby": "^2.3.23",
32 | "react": "^16.8.6",
33 | "react-dom": "^16.8.6"
34 | },
35 | "repository": "jxnblk/gatsby-themes",
36 | "keywords": [
37 | "gatsby",
38 | "gatsby-theme",
39 | "gatsby-plugin",
40 | "theme-ui"
41 | ]
42 | }
43 |
--------------------------------------------------------------------------------
/packages/conference/src/components/background-image.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from 'theme-ui'
3 |
4 | export default ({
5 | src,
6 | ratio = 1,
7 | ...props
8 | }) =>
9 |
20 |
--------------------------------------------------------------------------------
/packages/conference/src/components/banner.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import React from 'react'
3 | import { jsx, Styled, Container } from 'theme-ui'
4 | import useSiteMetadata from '../use-site-metadata'
5 | import Button from './button'
6 |
7 | export default props => {
8 | const {
9 | title,
10 | description
11 | } = useSiteMetadata()
12 |
13 | return (
14 |
19 |
20 |
25 | {title}
26 |
27 |
32 | {description}
33 |
34 |
35 |
36 |
37 | Buy Tickets
38 |
39 |
40 |
41 | )
42 | }
43 |
--------------------------------------------------------------------------------
/packages/conference/src/components/button.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Styled, jsx } from 'theme-ui'
3 |
4 | export default props =>
5 |
24 |
--------------------------------------------------------------------------------
/packages/conference/src/components/card.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Styled, jsx } from 'theme-ui'
3 |
4 | export default ({
5 | width = 320,
6 | ...props
7 | }) =>
8 |
17 |
--------------------------------------------------------------------------------
/packages/conference/src/components/cta.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx, Container } from 'theme-ui'
3 | import Button from './button'
4 |
5 | export default props =>
6 |
11 |
12 |
13 | Buy Tickets
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/packages/conference/src/components/desktop-only.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { jsx } from 'theme-ui'
3 |
4 | export default props => {
5 | const children = React.Children.toArray(props.children)
6 | .map((child, i) => {
7 | return jsx(child.type, {
8 | key: i,
9 | ...child.props,
10 | css: theme => ({
11 | [`@media screen and (max-width: ${theme.breakpoints[1]})`]: {
12 | display: 'none',
13 | }
14 | })
15 | })
16 | })
17 |
18 | return (
19 | <>
20 | {children}
21 | >
22 | )
23 | }
24 |
--------------------------------------------------------------------------------
/packages/conference/src/components/flex-list.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from 'theme-ui'
3 | import List from './list'
4 |
5 | export default props =>
6 |
13 |
--------------------------------------------------------------------------------
/packages/conference/src/components/footer.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Link } from 'gatsby'
3 | import { jsx, Styled, Flex, Container } from 'theme-ui'
4 | import { Twitter, Instagram } from 'react-feather'
5 | import useSiteMetadata from '../use-site-metadata'
6 | import List from './list'
7 | import NavLink from './nav-link'
8 | import IconLink from './icon-link'
9 |
10 | export default props => {
11 | const { twitter, instagram } = useSiteMetadata()
12 |
13 | return (
14 |
15 |
20 |
21 |
22 | Speakers
23 | Schedule
24 | Venue
25 | Sponsors
26 |
27 |
28 |
29 |
30 | Tickets
31 | Code of Conduct
32 | Scholarship
33 | Privacy Policy
34 |
35 |
36 |
37 | {twitter && (
38 |
39 |
40 |
41 | )}
42 | {instagram && (
43 |
44 |
45 |
46 | )}
47 |
48 |
49 |
50 |
55 | © 2019 Gatsby, Inc.
56 |
57 |
58 |
59 | )
60 | }
61 |
--------------------------------------------------------------------------------
/packages/conference/src/components/header.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import React from 'react'
3 | import { Link } from 'gatsby'
4 | import { jsx } from 'theme-ui'
5 | import useSiteMetadata from '../use-site-metadata'
6 | import NavLink from './nav-link'
7 | import Button from './button'
8 | import DesktopOnly from './desktop-only'
9 |
10 | export default props => {
11 | const { title } = useSiteMetadata()
12 |
13 | return (
14 | <>
15 | {title}
16 |
17 |
18 | Speakers
19 | Schedule
20 | Venue
21 | Sponsors
22 |
23 | Buy Tickets
24 | >
25 | )
26 | }
27 |
--------------------------------------------------------------------------------
/packages/conference/src/components/icon-link.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Styled, jsx } from 'theme-ui'
3 |
4 | export default props =>
5 | svg': {
16 | display: 'inline-block',
17 | verticalAlign: 'middle',
18 | }
19 | }}
20 | />
21 |
--------------------------------------------------------------------------------
/packages/conference/src/components/index.js:
--------------------------------------------------------------------------------
1 | export { default as Button } from './button'
2 | export { default as NavLink } from './nav-link'
3 | export { default as IconLink } from './icon-link'
4 | export { default as DesktopOnly } from './desktop-only'
5 | export { default as List } from './list'
6 | export { default as FlexList } from './flex-list'
7 | export { default as Card } from './card'
8 | export { default as BackgroundImage } from './background-image'
9 |
--------------------------------------------------------------------------------
/packages/conference/src/components/layout.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Global } from '@emotion/core'
3 | import * as UI from 'theme-ui'
4 | import { jsx } from 'theme-ui'
5 | import Header from './header'
6 | import Footer from './footer'
7 |
8 | export default props =>
9 |
18 |
24 |
31 |
32 |
33 |
34 | {props.children}
35 |
36 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/packages/conference/src/components/list.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Styled, jsx } from 'theme-ui'
3 |
4 | export default props =>
5 |
12 |
--------------------------------------------------------------------------------
/packages/conference/src/components/mc-card.js:
--------------------------------------------------------------------------------
1 | export { default } from './speaker-card'
2 |
--------------------------------------------------------------------------------
/packages/conference/src/components/mcs.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx, Container } from 'theme-ui'
3 | import SectionHeading from './section-heading'
4 | import FlexList from './flex-list'
5 | import MCCard from './mc-card'
6 |
7 | export default ({
8 | mcs = []
9 | }) =>
10 |
13 |
14 |
15 | MCs
16 |
17 |
21 | {mcs.map(mc => (
22 |
27 | ))}
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/packages/conference/src/components/nav-link.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Styled, jsx } from 'theme-ui'
3 |
4 | export default props =>
5 |
18 |
--------------------------------------------------------------------------------
/packages/conference/src/components/schedule-item.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx, Styled, Flex } from 'theme-ui'
3 |
4 | export default ({
5 | date,
6 | time,
7 | speaker,
8 | title,
9 | description,
10 | }) =>
11 |
16 |
21 |
25 | {time}
26 |
27 |
28 |
33 |
37 | {title}
38 |
39 | {speaker && speaker.name}
40 |
41 |
42 |
43 |
44 |
45 | {description}
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/packages/conference/src/components/schedule.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Link } from 'gatsby'
3 | import { jsx, Styled, Container } from 'theme-ui'
4 | import groupBy from 'lodash.groupby'
5 | import List from './list'
6 | import SectionHeading from './section-heading'
7 | import ScheduleItem from './schedule-item'
8 |
9 | export default ({
10 | schedule = []
11 | }) => {
12 | const days = groupBy(schedule, 'date')
13 |
14 | return (
15 |
18 |
19 |
20 | Schedule
21 |
22 | {Object.keys(days).map(date => (
23 |
24 |
25 | {date}
26 |
27 |
28 | {days[date].map(item => (
29 |
30 |
31 |
32 | ))}
33 |
34 |
35 | ))}
36 |
39 | View full schedule
40 |
41 |
42 |
43 | )
44 | }
45 |
--------------------------------------------------------------------------------
/packages/conference/src/components/section-heading.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx, Styled } from 'theme-ui'
3 |
4 | export default props =>
5 |
11 |
--------------------------------------------------------------------------------
/packages/conference/src/components/speaker-card.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Styled, jsx, Flex } from 'theme-ui'
3 | import {
4 | Twitter,
5 | GitHub
6 | } from 'react-feather'
7 | import BackgroundImage from './background-image'
8 | import Card from './card'
9 | import IconLink from './icon-link'
10 |
11 | export default ({
12 | id,
13 | name,
14 | image,
15 | bio,
16 | company,
17 | twitter,
18 | github,
19 | ...props
20 | }) =>
21 |
23 |
29 |
30 | {name}
31 |
32 |
38 | {company}
39 |
40 |
44 | {bio}
45 |
46 |
47 | {twitter && (
48 |
49 |
50 |
51 | )}
52 | {github && (
53 |
54 |
55 |
56 | )}
57 |
58 |
59 |
--------------------------------------------------------------------------------
/packages/conference/src/components/speakers.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Link } from 'gatsby'
3 | import { jsx, Styled, Container } from 'theme-ui'
4 | import SectionHeading from './section-heading'
5 | import FlexList from './flex-list'
6 | import SpeakerCard from './speaker-card'
7 |
8 | export default ({
9 | speakers = []
10 | }) =>
11 |
16 |
17 |
18 | Speakers
19 |
20 |
24 | {speakers.map(speaker => (
25 |
30 | ))}
31 |
32 |
36 |
39 | View all speakers
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/packages/conference/src/components/sponsors.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx, Styled, Container } from 'theme-ui'
3 | import SectionHeading from './section-heading'
4 | import FlexList from './flex-list'
5 | import Card from './card'
6 |
7 | export default ({
8 | sponsors = []
9 | }) =>
10 |
35 |
--------------------------------------------------------------------------------
/packages/conference/src/components/venue.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx, Styled, Flex, Container } from 'theme-ui'
3 | import SectionHeading from './section-heading'
4 |
5 | export default ({
6 | title,
7 | description,
8 | image,
9 | address,
10 | url,
11 | mapURL,
12 | }) =>
13 |
16 |
17 |
18 | Venue
19 |
20 |
26 |
32 |
38 |
39 |
45 |
{title}
46 |
50 | {address}
51 |
52 |
56 | {description}
57 |
58 |
59 | View Map
60 | {' | '}
61 | Website
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/packages/conference/src/data/mc.yml:
--------------------------------------------------------------------------------
1 | - id: mc-jay
2 | name: Jay Gatsby
3 | image: https://upload.wikimedia.org/wikipedia/en/4/42/JayGatsby1.jpg
4 | bio: A mysterious millionaire with shady business connections.
5 | company: Gatsby
6 | twitter: gatsbyjs
7 | github: gatsbyjs
8 |
--------------------------------------------------------------------------------
/packages/conference/src/data/schedule.yml:
--------------------------------------------------------------------------------
1 | - date: 2019-04-15 09:00
2 | title: Keynote
3 | speaker: daisy
4 | description: >
5 | Lollipop jelly beans tart biscuit icing croissant. Gummies apple pie candy canes. Candy canes gingerbread candy gummies jelly-o fruitcake. Jelly beans gummi bears caramels oat cake halvah cake gummies. Powder chupa chups jelly cake candy liquorice. Pie sweet roll fruitcake marshmallow chocolate. Sesame snaps biscuit apple pie cupcake cake jujubes icing gummi bears. Donut biscuit soufflé macaroon bear claw halvah toffee macaroon.
6 | - date: 2019-04-15 09:45
7 | title: Coffee Break
8 | description: Mix and mingle with other conference attendees and speakers
9 | - date: 2019-04-15 10:30
10 | title: Candy Canes
11 | speaker: jay
12 | description: >
13 | Candy canes cake pudding. Soufflé cake chocolate bar chocolate cake chocolate cake cheesecake cupcake cupcake muffin. Jujubes liquorice sesame snaps pie. Caramels pudding tiramisu jelly-o dragée pie tootsie roll. Macaroon candy halvah tart. Lollipop croissant pie tootsie roll bear claw bear claw donut ice cream. Gummies chupa chups sugar plum cupcake tiramisu candy canes danish wafer. Bonbon candy powder dessert muffin lemon drops. Bonbon brownie cotton candy topping donut ice cream jujubes soufflé.
14 | - date: 2019-04-16 09:00
15 | title: Pudding
16 | speaker: daisy
17 | description: >
18 | Candy canes cake pudding. Soufflé cake chocolate bar chocolate cake chocolate cake cheesecake cupcake cupcake muffin. Jujubes liquorice sesame snaps pie. Caramels pudding tiramisu jelly-o dragée pie tootsie roll. Macaroon candy halvah tart. Lollipop croissant pie tootsie roll bear claw bear claw donut ice cream. Gummies chupa chups sugar plum cupcake tiramisu candy canes danish wafer. Bonbon candy powder dessert muffin lemon drops. Bonbon brownie cotton candy topping donut ice cream jujubes soufflé.
19 |
--------------------------------------------------------------------------------
/packages/conference/src/data/speakers.yml:
--------------------------------------------------------------------------------
1 | - id: jay
2 | name: Jay Gatsby
3 | image: https://upload.wikimedia.org/wikipedia/en/4/42/JayGatsby1.jpg
4 | bio: A mysterious millionaire
5 | company: Gatsby
6 | twitter: gatsbyjs
7 | github: gatsbyjs
8 | - id: daisy
9 | name: Daisy Buchanan
10 | _image: https://upload.wikimedia.org/wikipedia/en/d/df/Daisy_Buchanan.png
11 | image: https://compote.slate.com/images/589ce9de-a6be-4167-b1ef-59be7f707ed6.jpg
12 | bio: Courteous driver
13 | company: Gatsby
14 | twitter: gatsbyjs
15 | github: gatsbyjs
16 |
--------------------------------------------------------------------------------
/packages/conference/src/data/sponsors.yml:
--------------------------------------------------------------------------------
1 | - id: gatsby
2 | name: Gatsby
3 | url: https://gatsbyjs.org
4 | logo: https://mutability.netlify.com/Gatsby-Logo.svg
5 | tier: platinum
6 |
--------------------------------------------------------------------------------
/packages/conference/src/data/venue.yml:
--------------------------------------------------------------------------------
1 | venue:
2 | title: Grand Theater
3 | address: 1234 Main St
4 | url: http://example.com
5 | description: >
6 | Wafer caramels sweet dessert oat cake cotton candy marshmallow gingerbread. Dragée danish danish icing gummi bears brownie bear claw donut. Muffin marzipan marshmallow lollipop marshmallow cake bonbon brownie.
7 | image: https://lh5.googleusercontent.com/p/AF1QipOb3qewSnTdEdo1d7_ZojPFpDpm3h8i2jPLfNz9=w408-h272-k-no
8 | mapURL: https://www.google.com/maps/place/Empire+State+Building/@40.7484445,-73.9878531,17z/data=!3m1!4b1!4m5!3m4!1s0x89c259a9b3117469:0xd134e199a405a163!8m2!3d40.7484405!4d-73.9856644
9 |
--------------------------------------------------------------------------------
/packages/conference/src/gatsby-plugin-theme-ui/index.js:
--------------------------------------------------------------------------------
1 | const heading = {
2 | fontFamily: 'heading',
3 | lineHeight: 'heading',
4 | fontWeight: 'heading',
5 | m: 0,
6 | }
7 |
8 | export default {
9 | breakpoints: [ '40em', '52em', '64em' ],
10 | colors: {
11 | text: '#000',
12 | background: '#fff',
13 | primary: '#33e',
14 | secondary: '#11a',
15 | },
16 | fonts: {
17 | body: 'system-ui, sans-serif',
18 | heading: 'inherit',
19 | },
20 | fontSizes: [
21 | 12, 14, 16, 20, 24, 32, 48, 64, 96
22 | ],
23 | lineHeights: {
24 | body: 1.5,
25 | heading: 1.25,
26 | },
27 | fontWeights: {
28 | body: 400,
29 | heading: 700,
30 | bold: 700,
31 | },
32 | styles: {
33 | h1: {
34 | ...heading,
35 | fontSize: [5, 6, 7],
36 | },
37 | h2: {
38 | ...heading,
39 | fontSize: [5, 6],
40 | },
41 | h3: {
42 | ...heading,
43 | fontSize: [4],
44 | },
45 | h4: {
46 | ...heading,
47 | },
48 | h5: {
49 | ...heading,
50 | },
51 | h6: {
52 | ...heading,
53 | },
54 | p: {
55 | mt: 0,
56 | mb: 4,
57 | },
58 | a: {
59 | color: 'primary',
60 | '&:hover': {
61 | color: 'secondary',
62 | }
63 | },
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/packages/conference/src/index.js:
--------------------------------------------------------------------------------
1 | export { default as useSiteMetadata } from './use-site-metadata'
2 | export * from './components'
3 |
--------------------------------------------------------------------------------
/packages/conference/src/layouts/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Layout from '../components/layout'
3 | import Banner from '../components/banner'
4 | import Speakers from '../components/speakers'
5 | import Sponsors from '../components/sponsors'
6 | import Venue from '../components/venue'
7 | import MCs from '../components/mcs'
8 | import Schedule from '../components/schedule'
9 | import CTA from '../components/cta'
10 |
11 | export default ({
12 | speakers,
13 | schedule,
14 | sponsors,
15 | mcs,
16 | venue
17 | }) =>
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/packages/conference/src/layouts/schedule.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Styled, jsx, Container } from 'theme-ui'
3 | import groupBy from 'lodash.groupby'
4 | import Layout from '../components/layout'
5 | import List from '../components/list'
6 | import ScheduleItem from '../components/schedule-item'
7 |
8 | export default ({
9 | data,
10 | }) => {
11 | const schedule = data.allScheduleYaml.edges.map(edge => edge.node)
12 | const days = groupBy(schedule, 'date')
13 |
14 | return (
15 |
16 |
17 |
21 | Schedule
22 |
23 | {Object.keys(days).map(date => (
24 |
25 |
26 | {date}
27 |
28 |
29 | {days[date].map(item => (
30 |
31 |
32 |
33 | ))}
34 |
35 |
36 | ))}
37 |
38 |
39 | )
40 | }
41 |
--------------------------------------------------------------------------------
/packages/conference/src/layouts/speakers.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { Styled, jsx, Container } from 'theme-ui'
3 | import Layout from '../components/layout'
4 | import FlexList from '../components/flex-list'
5 | import SpeakerCard from '../components/speaker-card'
6 |
7 | export default ({
8 | data,
9 | }) => {
10 | const speakers = data.allSpeakersYaml.edges.map(edge => edge.node)
11 |
12 | return (
13 |
14 |
15 |
19 | Speakers
20 |
21 |
25 | {speakers.map(speaker => (
26 |
31 | ))}
32 |
33 |
34 |
35 | )
36 | }
37 |
--------------------------------------------------------------------------------
/packages/conference/src/pages/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { graphql } from 'gatsby'
3 | import Landing from '../layouts/index'
4 |
5 | export default props => {
6 | const { data } = props
7 | const speakers = data.allSpeakersYaml.edges.map(edge => edge.node)
8 | const schedule = data.allScheduleYaml.edges.map(edge => edge.node)
9 | const sponsors = data.allSponsorsYaml.edges.map(edge => edge.node)
10 | const mcs = data.allMcYaml.edges.map(edge => edge.node)
11 | const { venue } = data.dataYaml
12 |
13 | return (
14 |
22 | )
23 | }
24 |
25 | export const pageQuery = graphql`
26 | query {
27 | allSpeakersYaml {
28 | edges {
29 | node {
30 | id
31 | name
32 | bio
33 | image
34 | company
35 | twitter
36 | github
37 | }
38 | }
39 | }
40 | allSponsorsYaml {
41 | edges {
42 | node {
43 | id
44 | name
45 | url
46 | logo
47 | tier
48 | }
49 | }
50 | }
51 | allScheduleYaml {
52 | edges {
53 | node {
54 | date(formatString: "ddd, MMM Do")
55 | time: date(formatString: "h:mm a")
56 | title
57 | description
58 | speaker {
59 | name
60 | company
61 | }
62 | }
63 | }
64 | }
65 | allMcYaml {
66 | edges {
67 | node {
68 | id
69 | name
70 | bio
71 | image
72 | company
73 | twitter
74 | github
75 | }
76 | }
77 | }
78 | dataYaml {
79 | venue {
80 | title
81 | address
82 | description
83 | url
84 | mapURL
85 | image
86 | }
87 | }
88 | }
89 | `
90 |
--------------------------------------------------------------------------------
/packages/conference/src/pages/schedule.js:
--------------------------------------------------------------------------------
1 | import { graphql } from 'gatsby'
2 | import Schedule from '../layouts/schedule'
3 |
4 | export default Schedule
5 |
6 | export const pageQuery = graphql`
7 | query {
8 | allScheduleYaml {
9 | edges {
10 | node {
11 | date(formatString: "ddd, MMM Do")
12 | time: date(formatString: "h:mm a")
13 | title
14 | description
15 | speaker {
16 | name
17 | company
18 | }
19 | }
20 | }
21 | }
22 | }
23 | `
24 |
--------------------------------------------------------------------------------
/packages/conference/src/pages/speakers.js:
--------------------------------------------------------------------------------
1 | import { graphql } from 'gatsby'
2 | import Speakers from '../layouts/speakers'
3 |
4 | export default Speakers
5 |
6 | export const pageQuery = graphql`
7 | query {
8 | allSpeakersYaml {
9 | edges {
10 | node {
11 | id
12 | name
13 | bio
14 | image
15 | company
16 | twitter
17 | github
18 | }
19 | }
20 | }
21 | }
22 | `
23 |
--------------------------------------------------------------------------------
/packages/conference/src/use-site-metadata.js:
--------------------------------------------------------------------------------
1 | import { useStaticQuery, graphql } from 'gatsby'
2 |
3 | export default () => {
4 | const data = useStaticQuery(graphql`
5 | {
6 | site {
7 | siteMetadata {
8 | title
9 | description
10 | twitter
11 | instagram
12 | }
13 | }
14 | }
15 | `)
16 | return data.site.siteMetadata
17 | }
18 |
--------------------------------------------------------------------------------
/packages/css/README.md:
--------------------------------------------------------------------------------
1 |
2 | # gatsby-theme-css
3 |
4 | **EXPERIMENTAL** Gatsby MDX blog theme built with Theme UI & CSS modules
5 |
--------------------------------------------------------------------------------
/packages/css/content/posts/hello.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Hello
3 | date: 2019-08-15
4 | ---
5 |
6 | # Hello
7 |
8 | This is an experimental Gatsby MDX blog theme built with CSS modules.
9 | It uses the same theme specification as [Theme UI][],
10 | but uses CSS custom properties and lets you write styles with CSS modules.
11 | Thus, this does **not** include many of the features included in Theme UI, and is only meant as a demonstration of reusing theme objects with different implementations.
12 |
13 | **This is for demonstration purposes only**
14 | and isn't an officially recommended way of building Gatsby themes,
15 | since styles can still leak into other pages outside of this theme.
16 |
17 | If you're less familiar with CSS-in-JS libraries like Emotion,
18 | this theme is meant to be a gentler introduction to some of the features and concepts found in Theme UI.
19 | The `src/theme.js` module can be shadowed in order to customize the look and feel of this theme without needing to shadow other components.
20 | Colors, typography, and some layout styles can be adjusted directly from the theme, and all other styles are in `src/styles.module.css`.
21 |
22 | [theme ui]: https://theme-ui.com
23 |
--------------------------------------------------------------------------------
/packages/css/gatsby-browser.js:
--------------------------------------------------------------------------------
1 | export { wrapRootElement } from './src'
2 |
--------------------------------------------------------------------------------
/packages/css/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [
3 | 'gatsby-theme-blog-core',
4 | 'gatsby-plugin-catch-links',
5 | ],
6 | }
7 |
--------------------------------------------------------------------------------
/packages/css/gatsby-ssr.js:
--------------------------------------------------------------------------------
1 | export { wrapRootElement, onRenderBody } from './src'
2 |
--------------------------------------------------------------------------------
/packages/css/index.js:
--------------------------------------------------------------------------------
1 | export * from './src'
2 |
--------------------------------------------------------------------------------
/packages/css/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gatsby-theme-css",
3 | "version": "0.2.1",
4 | "main": "index.js",
5 | "license": "MIT",
6 | "scripts": {
7 | "start": "gatsby develop",
8 | "clean": "gatsby clean",
9 | "build": "gatsby build",
10 | "now-build": "gatsby build",
11 | "serve": "gatsby serve"
12 | },
13 | "devDependencies": {
14 | "gatsby": "^2.13.31",
15 | "react": "^16.8.6",
16 | "react-dom": "^16.8.6"
17 | },
18 | "peerDependencies": {
19 | "gatsby": "^2.13.31",
20 | "react": "^16.8.6",
21 | "react-dom": "^16.8.6"
22 | },
23 | "dependencies": {
24 | "@emotion/core": "^10.0.14",
25 | "@theme-ui/custom-properties": "^0.3.0",
26 | "gatsby-plugin-catch-links": "^2.1.2",
27 | "gatsby-theme-blog-core": "^1.1.0",
28 | "lodash.get": "^4.4.2",
29 | "pluralize": "^8.0.0"
30 | },
31 | "repository": "jxnblk/gatsby-themes",
32 | "keywords": [
33 | "gatsby",
34 | "gatsby-theme",
35 | "gatsby-plugin",
36 | "custom-properties",
37 | "css"
38 | ]
39 | }
40 |
--------------------------------------------------------------------------------
/packages/css/src/context.js:
--------------------------------------------------------------------------------
1 | import {
2 | createContext,
3 | useContext,
4 | } from 'react'
5 |
6 | export const Context = createContext({
7 | colorMode: 'light',
8 | setColorMode: () => {},
9 | theme: {},
10 | })
11 |
12 | export const useTheme = () => useContext(Context)
13 |
--------------------------------------------------------------------------------
/packages/css/src/gatsby-theme-blog-core/components/post.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { MDXRenderer } from 'gatsby-plugin-mdx'
3 | import { Post } from '../..'
4 |
5 | export default props => {
6 | const {
7 | title,
8 | date,
9 | excerpt,
10 | keywords,
11 | tags,
12 | body,
13 | } = props.data.blogPost
14 |
15 | const children = React.createElement(MDXRenderer, {
16 | children: body,
17 | })
18 |
19 | return React.createElement(Post, {
20 | ...props,
21 | title,
22 | date,
23 | excerpt,
24 | keywords,
25 | tags,
26 | children,
27 | })
28 | }
29 |
--------------------------------------------------------------------------------
/packages/css/src/gatsby-theme-blog-core/components/posts.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Posts } from '../..'
3 |
4 | export default props => {
5 | const posts = props.data.allBlogPost.edges
6 | .map(e => e.node)
7 |
8 | return React.createElement(Posts, {
9 | ...props,
10 | posts,
11 | })
12 | }
13 |
--------------------------------------------------------------------------------
/packages/css/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import theme from './theme'
3 | import Layout from './layout'
4 | import { Root } from './root'
5 |
6 | export { useTheme } from './context'
7 | export { default as ToggleColorMode } from './toggle-color-mode'
8 |
9 | export const wrapRootElement = ({ element, props }) => {
10 | return (
11 |
12 | {element}
13 |
14 | )
15 | }
16 |
17 | const noflash = `
18 | (function() {
19 | try {
20 | var mode = localStorage.getItem('theme-css-color-mode');
21 | if (!mode) return
22 | document.body.classList.add(mode);
23 | } catch (e) {}
24 | })();
25 | `
26 |
27 | export const onRenderBody = ({ setPreBodyComponents }) => {
28 | setPreBodyComponents([
29 |
34 | ])
35 | }
36 |
37 | export { default as Post } from './post'
38 | export { default as Posts } from './posts'
39 |
--------------------------------------------------------------------------------
/packages/css/src/layout.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import css from './layout.module.css'
3 |
4 | export default props =>
5 |
6 | {props.children}
7 |
8 |
--------------------------------------------------------------------------------
/packages/css/src/layout.module.css:
--------------------------------------------------------------------------------
1 | * { box-sizing: border-box }
2 | body { margin: 0 }
3 |
4 | .root {
5 | font-family: var(--font-body);
6 | font-size: var(--fontSize-3);
7 | line-height: var(--lineHeight-body);
8 | font-weight: var(--fontWeight-body);
9 | max-width: 768px;
10 | margin-left: auto;
11 | margin-right: auto;
12 | padding-top: var(--space-3);
13 | padding-bottom: var(--space-3);
14 | padding-left: var(--space-3);
15 | padding-right: var(--space-3);
16 | }
17 |
18 | .root h1,
19 | .root h2,
20 | .root h3,
21 | .root h4,
22 | .root h5,
23 | .root h6 {
24 | font-family: var(--font-heading);
25 | font-weight: var(--fontWeight-heading);
26 | line-height: var(--lineHeight-heading);
27 | margin-top: var(--space-4);
28 | margin-bottom: var(--space-3);
29 | }
30 |
31 | .root h1 { font-size: var(--fontSize-5) }
32 | .root h2 { font-size: var(--fontSize-4) }
33 | .root h3 { font-size: var(--fontSize-3) }
34 | .root h4 { font-size: var(--fontSize-2) }
35 | .root h5 { font-size: var(--fontSize-1) }
36 | .root h6 { font-size: var(--fontSize-0) }
37 |
38 | .root p {}
39 | .root a {
40 | color: var(--color-primary);
41 | }
42 |
--------------------------------------------------------------------------------
/packages/css/src/post.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Layout from './layout'
3 |
4 | export default props =>
5 |
6 | {props.title}
7 | {props.date}
8 | {props.children}
9 |
10 |
--------------------------------------------------------------------------------
/packages/css/src/posts.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Link } from 'gatsby'
3 | import Layout from './layout'
4 | import css from './posts.module.css'
5 |
6 | export default ({
7 | posts,
8 | }) =>
9 |
10 |
11 | {posts.map(post => (
12 |
13 |
14 | {post.title}
15 | {post.excerpt}
16 |
17 |
18 | ))}
19 |
20 |
21 |
--------------------------------------------------------------------------------
/packages/css/src/posts.module.css:
--------------------------------------------------------------------------------
1 | .list {
2 | list-style: none;
3 | padding: 0;
4 | margin: 0;
5 | }
6 |
7 | .list h2 {
8 | font-size: var(--fontSize-5);
9 | font-weight: var(--fontWeight-bold);
10 | line-height: var(--lineHeight-heading);
11 | }
12 |
13 | .list a {
14 | display: block;
15 | text-decoration: none;
16 | color: inherit;
17 | }
18 |
19 | .list a:hover h2,
20 | .list a:focus h2 {
21 | text-decoration: underline;
22 | color: var(--color-primary);
23 | }
24 |
--------------------------------------------------------------------------------
/packages/css/src/root.js:
--------------------------------------------------------------------------------
1 | import React, {
2 | createContext,
3 | useContext,
4 | useEffect,
5 | useState,
6 | } from 'react'
7 | import { Global } from '@emotion/core'
8 | import pluralize from 'pluralize'
9 | import { Context } from './context'
10 |
11 | const STORAGE_KEY = 'theme-css-color-mode'
12 | const storage = {
13 | get: fallback => window.localStorage.getItem(STORAGE_KEY) || fallback,
14 | set: value => window.localStorage.setItem(STORAGE_KEY, value)
15 | }
16 |
17 | export const useColorState = (initialMode = 'light') => {
18 | const [ mode, setMode ] = useState(initialMode)
19 |
20 | useEffect(() => {
21 | const stored = storage.get()
22 | if (!stored || stored === mode) return
23 | setMode(stored)
24 | }, [])
25 |
26 | useEffect(() => {
27 | if (!mode) return
28 | storage.set(mode)
29 | document.body.classList.add(mode)
30 | return () => {
31 | document.body.classList.remove(mode)
32 | }
33 | }, [mode])
34 |
35 | return [ mode, setMode ]
36 | }
37 |
38 | const keyToVar = (...keys) => `--${keys.join('-')}`
39 | const toPixel = val => typeof val === 'number' ? `${val}px` : val
40 |
41 | const createColorModes = (modes) => {
42 | let styles = {}
43 | for (let key in modes) {
44 | const mode = modes[key]
45 | styles[`&.${key}`] = objectToVars('colors', mode)
46 | }
47 | return styles
48 | }
49 |
50 | const shouldConvertPixels = property => {
51 | return ![
52 | 'lineHeight',
53 | 'fontWeight',
54 | ].includes(property)
55 | }
56 |
57 | const objectToVars = (name, obj) => {
58 | let vars = {}
59 | const singular = pluralize.singular(name)
60 | for (let key in obj) {
61 | const ref = keyToVar(singular, key)
62 | const value = obj[key]
63 | if (name === 'colors' && key === 'modes') {
64 | Object.assign(vars, createColorModes(value))
65 | } else if (typeof value === 'object') {
66 | Object.assign(vars, objectToVars([singular, key].join('-'), value))
67 | } else if (shouldConvertPixels(singular)) {
68 | vars[ref] = toPixel(value)
69 | } else {
70 | vars[ref] = value
71 | }
72 | }
73 | return vars
74 | }
75 |
76 | const themeToCustomProperties = theme => {
77 | let styles = {
78 | // margin: 0,
79 | color: 'var(--color-text)',
80 | backgroundColor: 'var(--color-background)',
81 | }
82 | for (let key in theme) {
83 | const value = theme[key]
84 | Object.assign(styles, objectToVars(key, value))
85 | }
86 | return styles
87 | }
88 |
89 | export const Root = ({ theme, children }) => {
90 | const [ colorMode, setColorMode ] = useColorState('light')
91 |
92 | const styles = themeToCustomProperties(theme)
93 | const context = {
94 | colorMode,
95 | setColorMode,
96 | theme,
97 | }
98 |
99 | return (
100 |
101 |
106 | {children}
107 |
108 | )
109 | }
110 |
--------------------------------------------------------------------------------
/packages/css/src/theme.js:
--------------------------------------------------------------------------------
1 | export default {
2 | colors: {
3 | text: '#001',
4 | background: '#fff',
5 | primary: '#07c',
6 | secondary: '#609',
7 | modes: {
8 | dark: {
9 | text: '#fff',
10 | background: '#111',
11 | primary: '#0cf',
12 | secondary: '#609',
13 | },
14 | }
15 | },
16 | fonts: {
17 | body: 'system-ui, sans-serif',
18 | heading: 'system-ui, sans-serif',
19 | monospace: 'Menlo, monospace',
20 | },
21 | lineHeights: {
22 | body: 1.625,
23 | heading: 1.25,
24 | },
25 | fontWeights: {
26 | body: 400,
27 | heading: 700,
28 | bold: 700,
29 | },
30 | fontSizes: [
31 | 12, 14, 16, 18, 24, 32, 48, 64, 72, 96,
32 | ],
33 | space: [
34 | 0, 4, 8, 16, 32, 64, 128, 256, 512, 1024,
35 | ],
36 | }
37 |
--------------------------------------------------------------------------------
/packages/css/src/toggle-color-mode.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { useTheme } from './context'
3 | import get from 'lodash.get'
4 |
5 | export default props => {
6 | const { colorMode, setColorMode, theme } = useTheme()
7 | const modes = [
8 | 'light',
9 | ...Object.keys(get(theme, 'colors.modes', {}))
10 | ]
11 | const toggleMode = e => {
12 | const i = modes.indexOf(colorMode)
13 | const n = (i + 1) % modes.length
14 | setColorMode(modes[n])
15 | }
16 |
17 | return (
18 |
23 | )
24 | }
25 |
--------------------------------------------------------------------------------
/packages/jxnblk/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [
3 | 'gatsby-plugin-theme-ui',
4 | ],
5 | }
6 |
--------------------------------------------------------------------------------
/packages/jxnblk/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gatsby-theme-jxnblk",
3 | "version": "0.1.1",
4 | "main": "gatsby-config.js",
5 | "license": "MIT",
6 | "dependencies": {
7 | "@emotion/core": "^10.0.14",
8 | "@mdx-js/react": "^1.0.27",
9 | "gatsby-plugin-theme-ui": "^0.2.18",
10 | "theme-ui": "^0.2.21"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/packages/jxnblk/src/gatsby-plugin-theme-ui/index.js:
--------------------------------------------------------------------------------
1 | export default {
2 | initialColorMode: 'light',
3 | colors: {
4 | text: '#000',
5 | background: '#fff',
6 | primary: '#07c',
7 | muted: 'hsla(0, 0%, 0%, .0625)',
8 | modes: {
9 | dark: {
10 | text: '#fff',
11 | background: '#000',
12 | primary: '#0cf',
13 | muted: 'hsla(0, 0%, 100%, .0625)',
14 | },
15 | },
16 | },
17 | fonts: {
18 | body: 'system-ui, sans-serif',
19 | heading: 'system-ui, sans-serif',
20 | monospace: 'Menlo, monospace',
21 | },
22 | lineHeights: {
23 | body: 1.625,
24 | heading: 1.25,
25 | },
26 | fontWeights: {
27 | body: 400,
28 | heading: 800,
29 | bold: 700,
30 | },
31 | fontSizes: [
32 | 14, 16, 18, 20, 24, 32, 64
33 | ],
34 | sizes: {
35 | container: 768,
36 | },
37 | type: {
38 | heading: {
39 | fontFamily: 'heading',
40 | fontWeight: 'heading',
41 | lineHeight: 'heading',
42 | mt: 5,
43 | mb: 2,
44 | a: {
45 | color: 'inherit',
46 | }
47 | },
48 | },
49 | styles: {
50 | root: {
51 | fontFamily: 'body',
52 | lineHeight: 'body',
53 | fontWeight: 'body',
54 | fontSize: 2,
55 | },
56 | h1: {
57 | variant: 'type.heading',
58 | fontSize: 6,
59 | },
60 | h2: {
61 | variant: 'type.heading',
62 | fontSize: 5,
63 | },
64 | h3: {
65 | variant: 'type.heading',
66 | fontSize: 4,
67 | },
68 | h4: {
69 | variant: 'type.heading',
70 | fontSize: 3,
71 | },
72 | h5: {
73 | variant: 'type.heading',
74 | fontSize: 2,
75 | },
76 | h6: {
77 | variant: 'type.heading',
78 | fontSize: 1,
79 | },
80 | a: {
81 | color: 'primary',
82 | },
83 | img: {
84 | maxWidth: '100%',
85 | height: 'auto',
86 | },
87 | blockquote: {
88 | fontWeight: 'bold',
89 | mx: 0,
90 | my: 5,
91 | pl: 3,
92 | borderLeft: '4px solid',
93 | },
94 | p: {
95 | my: 3,
96 | },
97 | ol: {
98 | my: 3,
99 | },
100 | ul: {
101 | my: 3,
102 | },
103 | },
104 | }
105 |
--------------------------------------------------------------------------------
/packages/mono/README.md:
--------------------------------------------------------------------------------
1 |
2 | # gatsby-theme-mono
3 |
4 | A [Theme UI][] preset theme for [Gatsby][]
5 |
6 | ```sh
7 | npm i gatsby-theme-mono
8 | ```
9 |
10 | ## Usage
11 |
12 | This theme is built with composition in mind and can be used as the basis for a custom theme or to adjust the styles in other themes.
13 |
14 | ### Composed with other themes
15 |
16 | ```js
17 | // gatsby-config.js
18 | module.exports = {
19 | plugins: [
20 | 'gatsby-theme-blog',
21 | 'gatsby-theme-mono',
22 | ]
23 | }
24 | ```
25 |
26 | ```js
27 | // gatsby-config.js
28 | module.exports = {
29 | plugins: [
30 | 'gatsby-theme-notes',
31 | 'gatsby-theme-mono',
32 | ]
33 | }
34 | ```
35 |
36 | ### As a base theme
37 |
38 | The styles in this theme can be used as a starting point for custom themes.
39 |
40 | ```js
41 | // gatsby-config.js
42 | module.exports = {
43 | plugins: [
44 | 'gatsby-theme-mono',
45 | 'gatsby-plugin-theme-ui',
46 | ]
47 | }
48 | ```
49 |
50 | ```js
51 | // src/gatsby-plugin-theme-ui/index.js
52 | import baseTheme from 'gatsby-theme-mono'
53 |
54 | export default {
55 | ...baseTheme,
56 | // add custom styles to override the base theme
57 | }
58 | ```
59 |
60 | See the [Theme UI][] docs for more info on how to use the styles in your custom theme.
61 |
62 | MIT License
63 |
64 | [gatsby]: https://gatsbyjs.org
65 | [theme ui]: https://theme-ui.com
66 |
--------------------------------------------------------------------------------
/packages/mono/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [
3 | 'gatsby-plugin-theme-ui',
4 | {
5 | resolve: 'gatsby-plugin-google-fonts',
6 | options: {
7 | fonts: [
8 | 'roboto mono\:400,400i,700',
9 | ],
10 | display: 'swap',
11 | }
12 | }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/mono/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gatsby-theme-mono",
3 | "version": "0.1.2",
4 | "main": "gatsby-config.js",
5 | "license": "MIT",
6 | "peerDependencies": {
7 | "gatsby": "^2.13.36",
8 | "react": "^16.8.6",
9 | "react-dom": "^16.8.6"
10 | },
11 | "dependencies": {
12 | "@emotion/core": "^10.0.14",
13 | "@mdx-js/react": "^1.0.27",
14 | "gatsby-plugin-theme-ui": "^0.2.18",
15 | "theme-ui": "^0.2.18"
16 | },
17 | "repository": "jxnblk/gatsby-themes",
18 | "keywords": [
19 | "gatsby",
20 | "gatsby-theme",
21 | "gatsby-plugin",
22 | "blog",
23 | "mdx",
24 | "theme-ui"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/packages/mono/src/gatsby-plugin-theme-ui/index.js:
--------------------------------------------------------------------------------
1 | export default {
2 | initialColorMode: 'light',
3 | colors: {
4 | text: '#111126',
5 | background: '#fff',
6 | primary: '#33e',
7 | secondary: '#e3e',
8 | muted: '#f6f6f9',
9 | modes: {
10 | dark: {
11 | text: '#fff',
12 | background: '#353944',
13 | primary: '#3cf',
14 | secondary: '#39c',
15 | muted: '#2d313a',
16 | }
17 | }
18 | },
19 | fonts: {
20 | body: '"Roboto Mono", Menlo, monospace',
21 | heading: 'inherit',
22 | monospace: '"Roboto Mono", Menlo, monospace',
23 | },
24 | fontSizes: [
25 | 12, 14, 16, 20, 24, 32, 48, 64,
26 | ],
27 | lineHeights: {
28 | body: 1.625,
29 | heading: 1.25,
30 | },
31 | fontWeights: {
32 | body: 400,
33 | heading: 700,
34 | bold: 700,
35 | },
36 | sizes: {
37 | container: 768,
38 | },
39 | type: {
40 | heading: {
41 | fontFamily: 'heading',
42 | fontWeight: 'heading',
43 | lineHeight: 'heading',
44 | a: {
45 | color: 'inherit',
46 | ':hover,:focus': {
47 | color: 'primary',
48 | }
49 | }
50 | },
51 | mono: {
52 | fontFamily: 'monospace',
53 | },
54 | caps: {
55 | textTransform: 'uppercase',
56 | letterSpacing: '0.2em',
57 | },
58 | },
59 | styles: {
60 | root: {
61 | fontFamily: 'body',
62 | fontWeight: 'body',
63 | lineHeight: 'body',
64 | },
65 | a: {
66 | color: 'primary',
67 | ':hover,:focus': {
68 | color: 'secondary',
69 | }
70 | },
71 | h1: {
72 | variant: 'type.heading',
73 | fontSize: 5,
74 | },
75 | h2: {
76 | variant: 'type.heading',
77 | fontSize: 4,
78 | },
79 | h3: {
80 | variant: 'type.heading',
81 | fontSize: 3,
82 | },
83 | h4: {
84 | variant: 'type.heading',
85 | fontSize: 2,
86 | },
87 | h5: {
88 | variant: 'type.heading',
89 | fontSize: 1,
90 | },
91 | h6: {
92 | variant: 'type.caps',
93 | fontSize: 0,
94 | },
95 | pre: {
96 | variant: 'type.mono',
97 | overflow: 'auto',
98 | fontSize: 1,
99 | p: 3,
100 | // color: 'background',
101 | color: 'primary',
102 | bg: 'muted',
103 | borderRadius: 2,
104 | },
105 | code: {
106 | variant: 'type.mono',
107 | },
108 | inlineCode: {
109 | variant: 'type.mono',
110 | color: 'primary',
111 | bg: 'muted',
112 | },
113 | hr: {
114 | border: 0,
115 | borderBottom: '1px solid',
116 | borderColor: 'muted',
117 | },
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/packages/sidebar/README.md:
--------------------------------------------------------------------------------
1 |
2 | # gatsby-theme-sidebar
3 |
4 | A general-purpose Gatsby theme for creating sidebar layouts
5 |
6 | ```sh
7 | npm i gatsby-theme-sidebar
8 | ```
9 |
10 | ## Getting Started
11 |
12 | In your site's `gatsby-config.js` file, add the theme:
13 |
14 | ```js
15 | module.exports = {
16 | plugins: [
17 | 'gatsby-theme-sidebar'
18 | ]
19 | }
20 | ```
21 |
22 | ## Configuration
23 |
24 | Most of this theme's configuration can be handled by shadowing (or replacing) the theme's `Root` component.
25 | To shadow the `Root` component add a file named `src/gatsby-theme-sidebar/root.js` to your site.
26 |
27 | In this file, export a new component to override the theme's default.
28 |
29 | ```jsx
30 | // src/gatsby-theme-sidebar/root.js
31 | import React from 'react'
32 |
33 | export default ({
34 | Layout,
35 | Header,
36 | Main,
37 | Sidebar,
38 | Content,
39 | Footer,
40 | ...props
41 | }) =>
42 |
43 |
44 | your custom header content
45 |
46 |
47 |
48 | your custom sidebar content
49 |
50 |
51 | {props.children}
52 |
53 |
54 |
55 | your custom footer content
56 |
57 |
58 | ```
59 |
60 | The `Root` component is passed several layout components to make customization simple.
61 | Each component includes some minimal base styles for positioning and layout.
62 |
63 | ### Compositions
64 |
65 | These layout components can work with several different configurations. Here are a few examples (without children to aid in readability):
66 |
67 | ```jsx
68 | // without a footer
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | ```
77 |
78 | ```jsx
79 | // without a header
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | ```
88 |
89 | ```jsx
90 | // more examples to come...
91 | // without a sidebar
92 | // with max-widths
93 | // with sidebar on the right
94 | ```
95 |
96 | ### Custom Styles
97 |
98 | To customize the style for a single component, use Emotion's `css` prop.
99 |
100 | ```jsx
101 |
105 |
106 | ```
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/packages/sidebar/gatsby-browser.js:
--------------------------------------------------------------------------------
1 | export { wrapPageElement } from './src'
2 |
--------------------------------------------------------------------------------
/packages/sidebar/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [
3 | 'gatsby-plugin-emotion',
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/packages/sidebar/gatsby-ssr.js:
--------------------------------------------------------------------------------
1 | export { wrapPageElement } from './src'
2 |
--------------------------------------------------------------------------------
/packages/sidebar/index.js:
--------------------------------------------------------------------------------
1 | export * from './src'
2 |
--------------------------------------------------------------------------------
/packages/sidebar/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gatsby-theme-sidebar",
3 | "description": "A general-purpose Gatsby theme for creating sidebar layouts",
4 | "version": "0.0.2",
5 | "main": "index.js",
6 | "author": "Brent Jackson ",
7 | "license": "MIT",
8 | "scripts": {
9 | "clean": "rm -rf node_modules"
10 | },
11 | "dependencies": {
12 | "@emotion/core": "^10.0.7",
13 | "@emotion/styled": "^10.0.7",
14 | "gatsby-plugin-emotion": "^4.0.4",
15 | "lodash.merge": "^4.6.1"
16 | },
17 | "peerDependencies": {
18 | "gatsby": "^2.1.18",
19 | "react": "^16.8.3",
20 | "react-dom": "^16.8.3"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/sidebar/src/_config.js:
--------------------------------------------------------------------------------
1 | import merge from 'lodash.merge'
2 | import config from './config'
3 |
4 | export default merge({
5 | breakpoint: '40em',
6 | padding: 32,
7 | headerHeight: 64,
8 | headerFixed: true,
9 | }, config)
10 |
--------------------------------------------------------------------------------
/packages/sidebar/src/config.js:
--------------------------------------------------------------------------------
1 | // shadowable config file
2 |
3 | export default {
4 | // breakpoint for showing and hiding the sidebar based on viewport width
5 | // breakpoint: '32em',
6 |
7 | // default left and right padding
8 | // padding: 32,
9 |
10 | // headerHeight: 64,
11 | // headerFixed: true,
12 | }
13 |
--------------------------------------------------------------------------------
/packages/sidebar/src/container.js:
--------------------------------------------------------------------------------
1 | import styled from '@emotion/styled'
2 |
3 | export const Container = styled('div')({
4 | minWidth: 0,
5 | width: '100%',
6 | flex: '1 1 auto',
7 | marginLeft: 'auto',
8 | marginRight: 'auto',
9 | }, ({ maxWidth, padding }) => ({
10 | maxWidth,
11 | paddingLeft: padding,
12 | paddingRight: padding,
13 | }))
14 |
15 | Container.defaultProps = {
16 | padding: 32,
17 | }
18 |
19 | export default Container
20 |
--------------------------------------------------------------------------------
/packages/sidebar/src/content.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Container from './container'
3 |
4 | export default ({
5 | maxWidth = 768,
6 | padding,
7 | children,
8 | ...props
9 | }) =>
10 |
17 |
20 | {children}
21 |
22 |
23 |
--------------------------------------------------------------------------------
/packages/sidebar/src/footer.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Container from './container'
3 |
4 | export default ({
5 | maxWidth,
6 | padding,
7 | children,
8 | ...props
9 | }) =>
10 |
17 |
20 | {children}
21 |
22 |
23 |
--------------------------------------------------------------------------------
/packages/sidebar/src/header.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Container from './container'
3 |
4 | export const Header = ({
5 | maxWidth,
6 | padding,
7 | children,
8 | height = 64,
9 | fixed = true,
10 | ...props
11 | }) => {
12 | return (
13 | <>
14 | {fixed && (
15 |
20 | )}
21 |
31 |
34 |
40 | {children}
41 |
42 |
43 |
44 | >
45 | )
46 | }
47 |
48 | Header.isHeader = true
49 |
50 | export default Header
51 |
--------------------------------------------------------------------------------
/packages/sidebar/src/hooks.js:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from 'react'
2 | import config from './_config'
3 |
4 | export const useMedia = query => {
5 | const [ matches, setMatches ] = useState(true)
6 |
7 | useEffect(() => {
8 | const mq = window.matchMedia(query)
9 |
10 | const listener = () => {
11 | setMatches(mq.matches)
12 | }
13 |
14 | mq.addListener(listener)
15 | setMatches(mq.matches)
16 | return () => {
17 | mq.removeListener(listener)
18 | }
19 | }, [ query ])
20 |
21 | return matches
22 | }
23 |
24 | export const useBreakpoint = () => {
25 | return useMedia(`(max-width:${config.breakpoint})`)
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/packages/sidebar/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Root from './root'
3 | import Layout from './layout'
4 | import Header from './header'
5 | import Main from './main'
6 | import Content from './content'
7 | import Sidebar from './sidebar'
8 | import Footer from './footer'
9 | import MobileOnly from './mobile-only'
10 | import config from './_config'
11 |
12 | export const wrapPageElement = ({ element, props }) =>
13 |
25 |
26 | // component API
27 | export { default as Root } from './root'
28 | export { Layout, useLayout } from './layout'
29 | export { default as Header } from './header'
30 | export { default as Main } from './main'
31 | export { default as Content } from './content'
32 | export { default as Sidebar } from './sidebar'
33 | export { default as Footer } from './footer'
34 | export { default as MobileOnly } from './mobile-only'
35 | export { default as Container } from './container'
36 | export { default as Spacer } from './spacer'
37 |
--------------------------------------------------------------------------------
/packages/sidebar/src/layout.js:
--------------------------------------------------------------------------------
1 | import React, { useContext } from 'react'
2 | import { Global } from '@emotion/core'
3 | import config from './_config'
4 |
5 | export const Context = React.createContext({})
6 | export const useLayout = () => useContext(Context)
7 |
8 | export const Layout = props => {
9 | const context = {
10 | ...config,
11 | ...props,
12 | hasHeader: false,
13 | headerHeight: 64,
14 | }
15 | const children = React.Children.toArray(props.children)
16 |
17 | children.forEach(child => {
18 | if (child.type.isHeader) {
19 | context.hasHeader = true
20 | const { height } = child.props
21 | if (height) context.headerHeight = height
22 | }
23 | })
24 |
25 | return (
26 | <>
27 |
37 |
38 |
45 | {children}
46 |
47 |
48 | >
49 | )
50 | }
51 |
52 | export default Layout
53 |
--------------------------------------------------------------------------------
/packages/sidebar/src/main.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Container from './container'
3 |
4 | export default ({
5 | maxWidth,
6 | ...props
7 | }) => {
8 | const children = React.Children.toArray(props.children)
9 | .map((child, i) => React.cloneElement(child, {
10 | index: i
11 | }))
12 |
13 | return (
14 |
27 | )
28 | }
29 |
--------------------------------------------------------------------------------
/packages/sidebar/src/mobile-only.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { useLayout } from './layout'
3 |
4 | export default props => {
5 | const { breakpoint } = useLayout()
6 | return (
7 |
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/packages/sidebar/src/root.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react'
2 | import MobileOnly from './mobile-only'
3 |
4 | export default ({
5 | Layout,
6 | Header,
7 | Main,
8 | Sidebar,
9 | Content,
10 | Footer,
11 | ...props
12 | }) => {
13 | const [ sidebarOpen, setSidebarOpen ] = useState(false)
14 |
15 | return (
16 |
17 |
18 | gatsby-theme-sidebar
19 |
20 | setSidebarOpen(!sidebarOpen)}>
21 | Menu
22 |
23 |
24 |
25 |
26 | { setSidebarOpen(false) }}>
29 |
30 | This is the Sidebar component
31 | You can put links and other things here.
32 |
33 |
34 | {props.children}
35 |
36 |
37 | © 2019 Made by Jxnblk
38 |
39 |
40 | )
41 | }
42 |
--------------------------------------------------------------------------------
/packages/sidebar/src/sidebar.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { useLayout } from './layout'
3 | import Container from './container'
4 |
5 | const Overlay = props =>
6 |
16 |
17 | const Root = ({
18 | breakpoint,
19 | top,
20 | width,
21 | open,
22 | ...props
23 | }) =>
24 |
46 |
47 | export default ({
48 | open,
49 | width = 256,
50 | onDismiss,
51 | ...props
52 | }) => {
53 | const { breakpoint, headerHeight } = useLayout()
54 |
55 | return (
56 | <>
57 | {open && (
58 |
61 | )}
62 |
69 | >
70 | )
71 | }
72 |
--------------------------------------------------------------------------------
/packages/sidebar/src/spacer.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | export default props =>
4 |
10 |
--------------------------------------------------------------------------------
/packages/swiss/README.md:
--------------------------------------------------------------------------------
1 |
2 | # gatsby-theme-swiss
3 |
4 | A [Theme UI][] preset theme for [Gatsby][]
5 |
6 | ```sh
7 | npm i gatsby-theme-swiss
8 | ```
9 |
10 | ## Usage
11 |
12 | This theme is built with composition in mind and can be used as the basis for a custom theme or to adjust the styles in other themes.
13 |
14 | ### Composed with other themes
15 |
16 | ```js
17 | // gatsby-config.js
18 | module.exports = {
19 | plugins: [
20 | 'gatsby-theme-blog',
21 | 'gatsby-theme-swiss',
22 | ]
23 | }
24 | ```
25 |
26 | ```js
27 | // gatsby-config.js
28 | module.exports = {
29 | plugins: [
30 | 'gatsby-theme-notes',
31 | 'gatsby-theme-swiss',
32 | ]
33 | }
34 | ```
35 |
36 | ### As a base theme
37 |
38 | The styles in this theme can be used as a starting point for custom themes.
39 |
40 | ```js
41 | // gatsby-config.js
42 | module.exports = {
43 | plugins: [
44 | 'gatsby-theme-swiss',
45 | 'gatsby-plugin-theme-ui',
46 | ]
47 | }
48 | ```
49 |
50 | ```js
51 | // src/gatsby-plugin-theme-ui/index.js
52 | import baseTheme from 'gatsby-theme-swiss'
53 |
54 | export default {
55 | ...baseTheme,
56 | // add custom styles to override the base theme
57 | }
58 | ```
59 |
60 | See the [Theme UI][] docs for more info on how to use the styles in your custom theme.
61 |
62 | MIT License
63 |
64 | [gatsby]: https://gatsbyjs.org
65 | [theme ui]: https://theme-ui.com
66 |
--------------------------------------------------------------------------------
/packages/swiss/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [
3 | 'gatsby-plugin-theme-ui',
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/packages/swiss/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gatsby-theme-swiss",
3 | "version": "0.1.2",
4 | "main": "gatsby-config.js",
5 | "license": "MIT",
6 | "peerDependencies": {
7 | "gatsby": "^2.13.36",
8 | "react": "^16.8.6",
9 | "react-dom": "^16.8.6"
10 | },
11 | "dependencies": {
12 | "@emotion/core": "^10.0.14",
13 | "@mdx-js/react": "^1.0.27",
14 | "gatsby-plugin-theme-ui": "^0.2.18",
15 | "theme-ui": "^0.2.18"
16 | },
17 | "repository": "jxnblk/gatsby-themes",
18 | "keywords": [
19 | "gatsby",
20 | "gatsby-theme",
21 | "gatsby-plugin",
22 | "blog",
23 | "mdx",
24 | "theme-ui"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/packages/swiss/src/gatsby-plugin-theme-ui/index.js:
--------------------------------------------------------------------------------
1 | export default {
2 | initialColorMode: 'light',
3 | colors: {
4 | text: 'black',
5 | background: 'white',
6 | primary: '#1100ff',
7 | secondary: '#ff3300',
8 | muted: '#e9f6ff',
9 | modes: {
10 | dark: {
11 | text: 'white',
12 | background: 'black',
13 | primary: '#1199ff',
14 | secondary: '#ff9900',
15 | muted: '#111',
16 | }
17 | }
18 | },
19 | fonts: {
20 | body: '"Helvetica Neue", Helvetica, Arial, sans-serif',
21 | heading: 'inherit',
22 | monospace: 'Menlo, monospace',
23 | },
24 | fontSizes: [
25 | 14, 16, 18, 20, 24, 32, 48, 64,
26 | ],
27 | lineHeights: {
28 | body: 1.625,
29 | heading: 1.25,
30 | },
31 | fontWeights: {
32 | body: 400,
33 | heading: 700,
34 | bold: 700,
35 | },
36 | sizes: {
37 | container: 768,
38 | },
39 | type: {
40 | heading: {
41 | fontFamily: 'heading',
42 | fontWeight: 'heading',
43 | lineHeight: 'heading',
44 | my: 3,
45 | a: {
46 | color: 'inherit',
47 | ':hover,:focus': {
48 | color: 'primary',
49 | }
50 | }
51 | },
52 | mono: {
53 | fontFamily: 'monospace',
54 | },
55 | },
56 | styles: {
57 | root: {
58 | fontFamily: 'body',
59 | fontWeight: 'body',
60 | lineHeight: 'body',
61 | },
62 | a: {
63 | color: 'primary',
64 | ':hover,:focus': {
65 | color: 'secondary',
66 | }
67 | },
68 | h1: {
69 | variant: 'type.heading',
70 | fontSize: [5, 6],
71 | },
72 | h2: {
73 | variant: 'type.heading',
74 | fontSize: [4, 5],
75 | },
76 | h3: {
77 | variant: 'type.heading',
78 | fontSize: 4,
79 | },
80 | h4: {
81 | variant: 'type.heading',
82 | fontSize: 3,
83 | },
84 | h5: {
85 | variant: 'type.heading',
86 | fontSize: 2,
87 | },
88 | h6: {
89 | variant: 'type.heading',
90 | fontSize: 2,
91 | },
92 | p: {
93 | my: 4,
94 | },
95 | pre: {
96 | variant: 'type.mono',
97 | overflow: 'auto',
98 | fontSize: 0,
99 | p: 3,
100 | my: 4,
101 | color: 'primary',
102 | bg: 'muted',
103 | borderRadius: 2,
104 | },
105 | code: {
106 | variant: 'type.mono',
107 | },
108 | inlineCode: {
109 | variant: 'type.mono',
110 | color: 'primary',
111 | },
112 | hr: {
113 | border: 0,
114 | borderBottom: '1px solid',
115 | borderColor: 'muted',
116 | my: 4,
117 | },
118 | blockquote: {
119 | fontSize: 3,
120 | fontWeight: 'bold',
121 | fontStyle: 'italic',
122 | borderLeft: '8px solid',
123 | pl: 3,
124 | ml: 0,
125 | my: 4,
126 | },
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/packages/system/README.md:
--------------------------------------------------------------------------------
1 | # gatsby-theme-system
2 |
3 | A minimalist Gatsby theme based on constraint-based design principles
4 |
5 | ```sh
6 | npm i gatsby-theme-system
7 | ```
8 |
9 | ## Features
10 |
11 | - [MDX][]
12 | - [Theme UI][]
13 | - Customizable layout, colors & typography
14 | - Built-in page layout component
15 | - MDX header and footer content
16 |
17 | ## Getting Started
18 |
19 | In your `gatsby-config.js`, add the theme:
20 |
21 | ```js
22 | // gatsby-config.js
23 | module.exports = {
24 | plugins: [
25 | 'gatsby-theme-system',
26 | ],
27 | }
28 | ```
29 |
30 | ## Theming
31 |
32 | Shadow the `src/gatsby-plugin-theme-ui/index.js` file to customize the theme.
33 |
34 | ## Header and Footer
35 |
36 | Shadow the `src/gatsby-theme-system/header.mdx` and `src/gatsby-theme-system/footer.mdx` files to customize the content in the header and footer.
37 |
38 | MIT License
39 |
40 | [mdx]: https://mdxjs.com
41 | [emotion]: https://emotion.sh
42 | [styled system]: https://styled-system.com
43 | [gatsby mdx]: https://github.com/ChristopherBiscardi/gatsby-mdx
44 | [theme ui]: https://github.com/system-ui/theme-ui
45 |
--------------------------------------------------------------------------------
/packages/system/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = (opts = {}) => {
2 | const {
3 | mdx = true,
4 | } = opts
5 |
6 | return {
7 | plugins: [
8 | 'gatsby-plugin-theme-ui',
9 | mdx && {
10 | resolve: 'gatsby-plugin-mdx',
11 | options: {
12 | extensions: [ '.mdx', '.md' ],
13 | }
14 | },
15 | ].filter(Boolean),
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/system/index.js:
--------------------------------------------------------------------------------
1 | export * from './src'
2 |
--------------------------------------------------------------------------------
/packages/system/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gatsby-theme-system",
3 | "description": "A minimalist Gatsby theme based on constraint-based design principles",
4 | "version": "0.2.1",
5 | "main": "index.js",
6 | "author": "Brent Jackson ",
7 | "license": "MIT",
8 | "scripts": {
9 | "clean": "rm -rf node_modules"
10 | },
11 | "dependencies": {
12 | "@emotion/core": "^10.0.7",
13 | "@mdx-js/mdx": "^1.0.0",
14 | "@mdx-js/react": "^1.0.0",
15 | "gatsby-plugin-mdx": "^1.0.15",
16 | "gatsby-plugin-theme-ui": "^0.2.16",
17 | "theme-ui": "^0.2.16"
18 | },
19 | "peerDependencies": {
20 | "gatsby": "^2.1.18",
21 | "react": "^16.8.3",
22 | "react-dom": "^16.8.3"
23 | },
24 | "repository": "jxnblk/gatsby-themes",
25 | "keywords": [
26 | "gatsby",
27 | "gatsby-theme",
28 | "gatsby-plugin",
29 | "blog",
30 | "mdx",
31 | "theme-ui"
32 | ]
33 | }
34 |
--------------------------------------------------------------------------------
/packages/system/src/footer.mdx:
--------------------------------------------------------------------------------
1 | - © 2019 Jxnblk
2 |
--------------------------------------------------------------------------------
/packages/system/src/gatsby-plugin-theme-ui/index.js:
--------------------------------------------------------------------------------
1 | export const theme = {
2 | colors: {
3 | text: '#000',
4 | background: '#fff',
5 | primary: '#07c',
6 | secondary: '#047',
7 | muted: '#f0f6f9',
8 | },
9 | fonts: {
10 | body: 'system-ui, sans-serif',
11 | heading: 'inherit',
12 | monospace: 'Menlo, monospace',
13 | },
14 | lineHeights: {
15 | body: 1.625,
16 | heading: 1.25,
17 | },
18 | fontWeight: {
19 | body: 400,
20 | heading: 700,
21 | bold: 700,
22 | },
23 | layout: {
24 | mdx: {
25 | ul: {
26 | listStyle: 'none',
27 | display: 'flex',
28 | alignItems: 'center',
29 | p: 0,
30 | m: 0,
31 | mx: -3,
32 | },
33 | li: {
34 | p: 3,
35 | a: {
36 | m: -3,
37 | }
38 | },
39 | a: {
40 | display: 'block',
41 | p: 3,
42 | fontWeight: 'bold',
43 | color: 'inherit',
44 | textDecoration: 'none',
45 | ':hover,:focus': {
46 | color: 'inherit',
47 | bg: 'primary',
48 | }
49 | }
50 | },
51 | header: {
52 | variant: 'layout.mdx',
53 | },
54 | main: {},
55 | container: {
56 | width: '100%',
57 | maxWidth: 768,
58 | mx: 'auto',
59 | px: 3,
60 | },
61 | footer: {
62 | variant: 'layout.mdx',
63 | fontSize: 1,
64 | },
65 | },
66 | type: {
67 | heading: {
68 | fontFamily: 'heading',
69 | fontWeight: 'heading',
70 | lineHeight: 'heading',
71 | },
72 | },
73 | styles: {
74 | root: {
75 | fontFamily: 'body',
76 | lineHeight: 'body',
77 | fontWeight: 'body',
78 | },
79 | a: {
80 | color: 'primary',
81 | '&:hover': {
82 | color: 'secondary',
83 | }
84 | },
85 | code: {
86 | fontFamily: 'monospace',
87 | fontSize: '87.5%',
88 | color: 'secondary',
89 | bg: 'muted',
90 | },
91 | pre: {
92 | p: 3,
93 | color: 'secondary',
94 | bg: 'muted',
95 | borderRadius: 2,
96 | overflowX: 'auto',
97 | },
98 | inlineCode: {
99 | fontFamily: 'monospace',
100 | fontSize: '87.5%',
101 | color: 'secondary',
102 | bg: 'muted',
103 | },
104 | hr: {
105 | borderColor: 'muted',
106 | },
107 | h1: {
108 | variant: 'type.heading',
109 | },
110 | h2: {
111 | variant: 'type.heading',
112 | },
113 | h3: {
114 | variant: 'type.heading',
115 | },
116 | h4: {
117 | variant: 'type.heading',
118 | },
119 | h5: {
120 | variant: 'type.heading',
121 | },
122 | h6: {
123 | variant: 'type.heading',
124 | },
125 | },
126 | }
127 |
128 | export default theme
129 |
--------------------------------------------------------------------------------
/packages/system/src/header.mdx:
--------------------------------------------------------------------------------
1 | - [gatsby-theme-system](/)
2 |
--------------------------------------------------------------------------------
/packages/system/src/index.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx } from 'theme-ui'
3 | import { Global } from '@emotion/core'
4 | import Header from './header.mdx'
5 | import Footer from './footer.mdx'
6 |
7 | const Container = props =>
8 |
14 |
15 | export const Layout = props =>
16 |
23 |
29 |
39 |
44 |
45 | {props.children}
46 |
47 |
48 |
58 |
59 |
--------------------------------------------------------------------------------
/packages/theme-ui-blog/README.md:
--------------------------------------------------------------------------------
1 |
2 | # gatsby-theme-ui-blog
3 |
4 | Minimal Gatsby MDX blog theme built with Theme UI
5 |
6 | ```sh
7 | npm i gatsby-theme-ui-blog
8 | ```
9 |
10 | ```js
11 | // gatsby-config.js
12 | module.exports = {
13 | plugins: [
14 | 'gatsby-theme-ui-blog',
15 | ]
16 | }
17 | ```
18 |
19 | ## Shadowing
20 |
21 | Shadow the following components to customize styles and page layout:
22 |
23 | Component | Description | Props
24 | ---|---|---
25 | `src/gatsby-theme-ui-blog/posts.js` | Index page for all blog posts | `{ posts }`
26 | `src/gatsby-theme-ui-blog/post.js` | Full blog post article page | `{ title, date, children, keywords, tags }`
27 | `src/gatsby-theme-ui-blog/layout.js` | Wrapping layout component for the Post and Posts components || all page-level props
28 |
29 | ## Theming
30 |
31 | Use `gatsby-plugin-theme-ui` to override or customize the theme.
32 |
33 | ```sh
34 | npm i gatsby-plugin-theme-ui
35 | ```
36 |
37 | ```js
38 | // gatsby-config.js
39 | module.exports = {
40 | plugins: [
41 | 'gatsby-theme-ui-blog',
42 | 'gatsby-plugin-theme-ui',
43 | ]
44 | }
45 | ```
46 |
47 | ```js
48 | // shadow src/gatsby-plugin-theme-ui/index.js
49 | import base from 'gatsby-theme-ui-blog/src/gatsby-plugin-theme-ui'
50 |
51 | export default {
52 | ...base,
53 | colors: {
54 | text: 'white',
55 | background: 'black',
56 | primary: 'cyan',
57 | secondary: 'magenta',
58 | }
59 | }
60 | ```
61 |
62 | ## Options
63 |
64 | This theme is based off of [gatsby-theme-blog-core][] and uses all the same options.
65 |
66 | [gatsby-theme-blog-core]: https://www.npmjs.com/package/gatsby-theme-blog-core
67 |
--------------------------------------------------------------------------------
/packages/theme-ui-blog/content/assets/avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jxnblk/gatsby-themes/ea0e19cfeef7fba0d112ffe7e78c94137f50a6dc/packages/theme-ui-blog/content/assets/avatar.png
--------------------------------------------------------------------------------
/packages/theme-ui-blog/content/posts/hello.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Hello
3 | date: 2019-08-14
4 | ---
5 |
6 | Hello, this is a blog theme built with `gatsby-theme-blog-core` and `theme-ui`.
7 | It uses `@theme-ui/preset-base` for minimal styling, and can be completely overridden or customized using `gatsby-plugin-theme-ui`.
8 | The pages generated by this theme contain no outer layout structure, making this theme a good starting point for building a custom blog with Theme UI.
9 |
--------------------------------------------------------------------------------
/packages/theme-ui-blog/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = options => ({
2 | plugins: [
3 | {
4 | resolve: 'gatsby-theme-blog-core',
5 | options
6 | },
7 | 'gatsby-plugin-theme-ui',
8 | ]
9 | })
10 |
--------------------------------------------------------------------------------
/packages/theme-ui-blog/index.js:
--------------------------------------------------------------------------------
1 | // boop
2 |
--------------------------------------------------------------------------------
/packages/theme-ui-blog/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gatsby-theme-ui-blog",
3 | "version": "1.0.1",
4 | "main": "index.js",
5 | "scripts": {
6 | "start": "gatsby develop",
7 | "build": "gatsby build",
8 | "clean": "gatsby clean",
9 | "avatar": "npx capture-website-cli \"https://contrast.now.sh/fff/33e?text=Gt&size=48&fontSize=1.5&radius=32&baseline=1\" content/assets/avatar.png --width=48 --height=48 --overwrite"
10 | },
11 | "license": "MIT",
12 | "devDependencies": {
13 | "gatsby": "^2.13.30",
14 | "react": "^16.9.0",
15 | "react-dom": "^16.9.0"
16 | },
17 | "dependencies": {
18 | "@emotion/core": "^10.0.15",
19 | "@theme-ui/preset-base": "^0.3.0",
20 | "gatsby-plugin-react-helmet": "^3.1.3",
21 | "gatsby-plugin-theme-ui": "^0.2.33",
22 | "gatsby-theme-blog-core": "^1.0.2",
23 | "react-helmet": "^5.2.1",
24 | "theme-ui": "^0.2.33"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/packages/theme-ui-blog/src/gatsby-plugin-theme-ui/index.js:
--------------------------------------------------------------------------------
1 | export { default } from '@theme-ui/preset-base'
2 |
--------------------------------------------------------------------------------
/packages/theme-ui-blog/src/gatsby-theme-blog-core/components/post.js:
--------------------------------------------------------------------------------
1 | import { jsx } from 'theme-ui'
2 | import { MDXRenderer } from 'gatsby-plugin-mdx'
3 | import Post from '../../post'
4 |
5 | export default props => {
6 | const { body } = props.data.blogPost
7 | const children = jsx(MDXRenderer, { children: body })
8 |
9 | return (
10 | jsx(Post, {
11 | ...props,
12 | ...props.data.blogPost,
13 | children,
14 | })
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/packages/theme-ui-blog/src/gatsby-theme-blog-core/components/posts.js:
--------------------------------------------------------------------------------
1 | import { jsx } from 'theme-ui'
2 | import Posts from '../../posts'
3 |
4 | export default props => {
5 | const posts = props.data.allBlogPost.edges
6 | .map(e => e.node)
7 |
8 | return jsx(Posts, {
9 | ...props,
10 | posts,
11 | })
12 | }
13 |
--------------------------------------------------------------------------------
/packages/theme-ui-blog/src/head.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Helmet } from 'react-helmet'
3 |
4 | export default ({
5 | lang = 'en-us',
6 | title,
7 | excerpt,
8 | children,
9 | ...props
10 | }) =>
11 |
16 | {title && {title} }
17 | {excerpt && }
18 | {children}
19 |
20 |
--------------------------------------------------------------------------------
/packages/theme-ui-blog/src/layout.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Head from './head'
3 |
4 | export default props =>
5 | <>
6 |
7 | {props.children}
8 | >
9 |
--------------------------------------------------------------------------------
/packages/theme-ui-blog/src/post.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx, Styled } from 'theme-ui'
3 | import Layout from './layout'
4 |
5 | export default ({
6 | title,
7 | date,
8 | excerpt,
9 | children,
10 | keywords,
11 | tags,
12 | ...props
13 | }) =>
14 |
15 |
19 | {title}
20 | {date}
21 | {children}
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/packages/theme-ui-blog/src/posts.js:
--------------------------------------------------------------------------------
1 | /** @jsx jsx */
2 | import { jsx, Styled } from 'theme-ui'
3 | import { Link } from 'gatsby'
4 | import Layout from './layout'
5 |
6 | export default ({
7 | posts,
8 | ...props
9 | }) =>
10 |
11 |
12 |
13 | {posts.map(post => (
14 |
15 |
16 | {post.title}
17 |
18 |
19 | ))}
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/packages/tomato/README.md:
--------------------------------------------------------------------------------
1 |
2 | # gatsby-theme-tomato
3 |
4 | A [Theme UI][] preset theme for [Gatsby][]
5 |
6 | ```sh
7 | npm i gatsby-theme-tomato
8 | ```
9 |
10 | ## Usage
11 |
12 | This theme is built with composition in mind and can be used as the basis for a custom theme or to adjust the styles in other themes.
13 |
14 | ### Composed with other themes
15 |
16 | ```js
17 | // gatsby-config.js
18 | module.exports = {
19 | plugins: [
20 | 'gatsby-theme-blog',
21 | 'gatsby-theme-tomato',
22 | ]
23 | }
24 | ```
25 |
26 | ```js
27 | // gatsby-config.js
28 | module.exports = {
29 | plugins: [
30 | 'gatsby-theme-notes',
31 | 'gatsby-theme-tomato',
32 | ]
33 | }
34 | ```
35 |
36 | ### As a base theme
37 |
38 | The styles in this theme can be used as a starting point for custom themes.
39 |
40 | ```js
41 | // gatsby-config.js
42 | module.exports = {
43 | plugins: [
44 | 'gatsby-theme-tomato',
45 | 'gatsby-plugin-theme-ui',
46 | ]
47 | }
48 | ```
49 |
50 | ```js
51 | // src/gatsby-plugin-theme-ui/index.js
52 | import baseTheme from 'gatsby-theme-tomato'
53 |
54 | export default {
55 | ...baseTheme,
56 | // add custom styles to override the base theme
57 | }
58 | ```
59 |
60 | See the [Theme UI][] docs for more info on how to use the styles in your custom theme.
61 |
62 | MIT License
63 |
64 | [gatsby]: https://gatsbyjs.org
65 | [theme ui]: https://theme-ui.com
66 |
--------------------------------------------------------------------------------
/packages/tomato/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [
3 | 'gatsby-plugin-theme-ui',
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/packages/tomato/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gatsby-theme-tomato",
3 | "version": "0.1.2",
4 | "main": "gatsby-config.js",
5 | "license": "MIT",
6 | "peerDependencies": {
7 | "gatsby": "^2.13.36",
8 | "react": "^16.8.6",
9 | "react-dom": "^16.8.6"
10 | },
11 | "dependencies": {
12 | "@emotion/core": "^10.0.14",
13 | "@mdx-js/react": "^1.0.27",
14 | "gatsby-plugin-theme-ui": "^0.2.18",
15 | "theme-ui": "^0.2.18"
16 | },
17 | "repository": "jxnblk/gatsby-themes",
18 | "keywords": [
19 | "gatsby",
20 | "gatsby-theme",
21 | "gatsby-plugin",
22 | "blog",
23 | "mdx",
24 | "theme-ui"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/packages/tomato/src/gatsby-plugin-theme-ui/index.js:
--------------------------------------------------------------------------------
1 | export default {
2 | initialColorMode: 'light',
3 | colors: {
4 | text: 'black',
5 | background: 'tomato',
6 | primary: '#110077',
7 | secondary: '#480c01',
8 | muted: '#fc5030',
9 | modes: {
10 | dark: {
11 | text: 'tomato',
12 | background: '#210600',
13 | primary: '#f88',
14 | secondary: '#f20',
15 | muted: '#000',
16 | }
17 | }
18 | },
19 | fonts: {
20 | body: 'system-ui, sans-serif',
21 | heading: 'inherit',
22 | monospace: 'Menlo, monospace',
23 | },
24 | fontSizes: [
25 | 14, 16, 18, 20, 24, 32, 48, 64,
26 | ],
27 | lineHeights: {
28 | body: 1.625,
29 | heading: 1.25,
30 | },
31 | fontWeights: {
32 | body: 400,
33 | heading: 900,
34 | bold: 700,
35 | },
36 | sizes: {
37 | container: 768,
38 | },
39 | type: {
40 | heading: {
41 | fontFamily: 'heading',
42 | fontWeight: 'heading',
43 | lineHeight: 'heading',
44 | a: {
45 | color: 'inherit',
46 | ':hover,:focus': {
47 | color: 'primary',
48 | }
49 | }
50 | },
51 | mono: {
52 | fontFamily: 'monospace',
53 | },
54 | caps: {
55 | textTransform: 'uppercase',
56 | letterSpacing: '0.2em',
57 | },
58 | },
59 | styles: {
60 | root: {
61 | fontFamily: 'body',
62 | fontSize: 3,
63 | fontWeight: 'body',
64 | lineHeight: 'body',
65 | },
66 | a: {
67 | color: 'primary',
68 | ':hover,:focus': {
69 | color: 'secondary',
70 | }
71 | },
72 | h1: {
73 | variant: 'type.heading',
74 | fontSize: [5, 6],
75 | mt: 4,
76 | mb: 2,
77 | },
78 | h2: {
79 | variant: 'type.heading',
80 | fontSize: [4, 5],
81 | mt: 4,
82 | mb: 2,
83 | },
84 | h3: {
85 | variant: 'type.heading',
86 | fontSize: 4,
87 | mt: 3,
88 | mb: 1,
89 | },
90 | h4: {
91 | variant: 'type.heading',
92 | fontSize: 3,
93 | mt: 3,
94 | mb: 1,
95 | },
96 | h5: {
97 | variant: 'type.heading',
98 | fontSize: 2,
99 | mt: 3,
100 | mb: 1,
101 | },
102 | h6: {
103 | variant: 'type.heading',
104 | fontSize: 2,
105 | mt: 3,
106 | mb: 1,
107 | },
108 | p: {
109 | mt: 0,
110 | mb: 4,
111 | },
112 | pre: {
113 | variant: 'type.mono',
114 | overflow: 'auto',
115 | fontSize: 1,
116 | p: 3,
117 | color: 'primary',
118 | bg: 'muted',
119 | borderRadius: 2,
120 | },
121 | code: {
122 | variant: 'type.mono',
123 | },
124 | inlineCode: {
125 | variant: 'type.mono',
126 | color: 'primary',
127 | bg: 'muted',
128 | },
129 | hr: {
130 | border: 0,
131 | borderBottom: '1px solid',
132 | borderColor: 'muted',
133 | },
134 | blockquote: {
135 | fontWeight: 'bold',
136 | fontStyle: 'italic',
137 | borderLeft: t => `4px solid ${t.colors.muted}`,
138 | pl: 3,
139 | ml: 0,
140 | my: 4,
141 | },
142 | }
143 | }
144 |
--------------------------------------------------------------------------------