├── .gitignore
├── README.md
├── gatsby-config.js
├── gatsby-node.js
├── netlify.toml
├── package.json
├── src
├── components
│ ├── hero.js
│ └── team-members.js
└── pages
│ └── index.js
├── watch.json
└── yarn.lock
/.gitignore:
--------------------------------------------------------------------------------
1 | public
2 | .cache
3 | node_modules
4 | .env
5 | .netlify
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # WordPress + Gatsby with Advanced Custom Fields and WPGraphQL
2 |
3 | This project was built as [part of a livestream](https://youtu.be/DH7I1xRrbxs?list=PLz8Iz-Fnk_eTpvd49Sa77NiF8Uqq5Iykx) on [Learn With Jason](https://www.youtube.com/playlist?list=PLz8Iz-Fnk_eTpvd49Sa77NiF8Uqq5Iykx).
4 |
5 | It uses WordPress as a data source via [WPGraphQL](https://www.wpgraphql.com/) to build a [Gatsby](https://gatsbyjs.org) site.
6 |
--------------------------------------------------------------------------------
/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [
3 | {
4 | resolve: 'gatsby-source-graphql',
5 | options: {
6 | typeName: 'WordPress',
7 | fieldName: 'wordPress',
8 | url: 'https://acf.wpgraphql.com/graphql',
9 | refetchInterval: 60
10 | }
11 | }
12 | ]
13 | };
14 |
--------------------------------------------------------------------------------
/gatsby-node.js:
--------------------------------------------------------------------------------
1 | // boop
2 |
--------------------------------------------------------------------------------
/netlify.toml:
--------------------------------------------------------------------------------
1 | # example netlify.toml
2 | [build]
3 | command = "yarn build"
4 | functions = "functions"
5 | publish = "public"
6 |
7 | ## Uncomment to use this redirect for Single Page Applications like create-react-app.
8 | ## Not needed for static site generators.
9 | #[[redirects]]
10 | # from = "/*"
11 | # to = "/index.html"
12 | # status = 200
13 |
14 | ## (optional) Settings for Netlify Dev
15 | ## https://github.com/netlify/netlify-dev-plugin#project-detection
16 | #[dev]
17 | # command = "yarn start" # Command to start your dev server
18 | # port = 3000 # Port that the dev server will be listening on
19 | # publish = "dist" # Folder with the static content for _redirect file
20 |
21 | ## more info on configuring this file: https://www.netlify.com/docs/netlify-toml-reference/
22 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "//1": "describes your app and its dependencies",
3 | "//2": "https://docs.npmjs.com/files/package.json",
4 | "//3": "updating this file will download and update your packages",
5 | "name": "hello-express",
6 | "version": "0.0.1",
7 | "description": "A Gatsby site!",
8 | "scripts": {
9 | "develop": "gatsby develop",
10 | "build": "gatsby build"
11 | },
12 | "dependencies": {
13 | "gatsby": "^2.0.97",
14 | "react": "^16.8.3",
15 | "react-dom": "^16.6.3",
16 | "gatsby-source-graphql": "^2.1.3"
17 | },
18 | "repository": {
19 | "url": "https://glitch.com/edit/#!/fanatical-willow"
20 | },
21 | "license": "MIT",
22 | "keywords": [
23 | "node",
24 | "glitch",
25 | "gatsby"
26 | ]
27 | }
28 |
--------------------------------------------------------------------------------
/src/components/hero.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { graphql } from 'gatsby';
3 |
4 | export const fragment = graphql`
5 | fragment HeroSection on WordPress_Page_Pagesectionfields_Sections_Hero {
6 | backgroundColor
7 | buttonLink
8 | buttonText
9 | description
10 | title
11 | }
12 | `;
13 |
14 | const Hero = ({
15 | backgroundColor,
16 | buttonLink,
17 | buttonText,
18 | description,
19 | title
20 | }) => (
21 | {description}{title}
29 |
37 | {teamMember.title}, {teamMember.profileFields.title}
38 |
39 |
43 |
You done busted it.
; 41 | } 42 | })} 43 |