Skip to content

Commit d85f9f8

Browse files
Starts Gatsby v2 example
1 parent 6ebd993 commit d85f9f8

15 files changed

+9797
-11
lines changed

examples/gatsby-v1/README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
<img alt="Gatsby" src="https://www.gatsbyjs.org/monogram.svg" width="60" />
33
</p>
44

5-
## Example of [gatsby-plugin-mailchimp](https://github.com/benjaminhoffman/gatsby-plugin-mailchimp) using [`gatsby-starter-default`](https://github.com/gatsbyjs/gatsby-starter-default) for Gatsby v1.
5+
## Example of `gatsby-plugin-mailchimp` for Gatsby v1.
66

77

8-
This is an example of this mailchimp plugin using Gatsby's v1 default starter. Nothing special, just wanted to show you a basic example of how to use this plugin. I cloned down the `gatsby-starter-default` and installed the mailchimp plugin. You can follow the instructions below and submit the form to see the results.
8+
This example repo combines `gatsby-starter-default` with `gatsby-plugin-mailchimp` for Gatsby **v1**. It's nothing special -- I didn't change anything. It's mostly used for you to see how to use this plugin.
9+
10+
See something missing from this example? Let me know and I will update it! ... or even better, open your own PR and I'll merge it!
11+
12+
You can follow the instructions below and submit the form to see the results.
913

1014
## Steps
11-
1. pull down repo
15+
1. clone down this repo
1216
2. add your mailchimp endpoint to `gatsby-config`
1317
3. `$ yarn install`
1418
4. `$ yarn develop`

examples/gatsby-v1/gatsby-browser.js

-7
This file was deleted.

examples/gatsby-v1/gatsby-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
{
88
resolve: 'gatsby-plugin-mailchimp',
99
options: {
10-
endpoint: 'https://LAcolon.us6.list-manage.com/subscribe/post?u=46b9f89ed6c3b91c8caf11b40&amp;id=dc7ff0b690',
10+
endpoint: '', // replace with your own Mailchimp endpoint for testing
1111
},
1212
},
1313
],

examples/gatsby-v1/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"scripts": {
1818
"build": "gatsby build",
1919
"develop": "gatsby develop",
20+
"serve": "gatsby serve",
2021
"format": "prettier --write 'src/**/*.js'",
2122
"test": "echo \"Error: no test specified\" && exit 1"
2223
},

examples/gatsby-v2/.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Project dependencies
2+
.cache
3+
node_modules
4+
yarn-error.log
5+
6+
# Build directory
7+
/public
8+
.DS_Store

examples/gatsby-v2/.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"trailingComma": "es5"
5+
}

examples/gatsby-v2/README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<p align="center">
2+
<img alt="Gatsby" src="https://www.gatsbyjs.org/monogram.svg" width="60" />
3+
</p>
4+
5+
## Example of `gatsby-plugin-mailchimp` for Gatsby v2.
6+
7+
8+
This example repo combines `gatsby-starter-default` with `gatsby-plugin-mailchimp` for Gatsby **v2**. It's nothing special -- I didn't change anything. It's mostly used for you to see how to use this plugin.
9+
10+
See something missing from this example? Let me know and I will update it! ... or even better, open your own PR and I'll merge it!
11+
12+
You can follow the instructions below and submit the form to see the results.
13+
14+
## Steps
15+
1. clone down this repo
16+
2. add your mailchimp endpoint to `gatsby-config`
17+
3. `$ yarn install`
18+
4. `$ yarn develop`
19+
5. go to `localhost:8000/` in your browser and open your the console
20+
6. submit a form. see the page & form state get logged to the screen

examples/gatsby-v2/gatsby-config.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
siteMetadata: {
3+
title: 'Gatsby Default Starter',
4+
},
5+
plugins: [
6+
'gatsby-plugin-react-helmet',
7+
{
8+
resolve: `gatsby-plugin-manifest`,
9+
options: {
10+
name: 'gatsby-starter-default',
11+
short_name: 'starter',
12+
start_url: '/',
13+
background_color: '#663399',
14+
theme_color: '#663399',
15+
display: 'minimal-ui',
16+
icon: 'src/images/gatsby-icon.png', // This path is relative to the root of the site.
17+
},
18+
},
19+
'gatsby-plugin-offline',
20+
{
21+
resolve: 'gatsby-plugin-mailchimp',
22+
options: {
23+
endpoint: '', // replace with your own Mailchimp endpoint for testing
24+
},
25+
},
26+
],
27+
}
28+

examples/gatsby-v2/package.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "gatsby-starter-default",
3+
"description": "Gatsby default starter",
4+
"version": "1.0.0",
5+
"author": "Kyle Mathews <[email protected]>",
6+
"dependencies": {
7+
"gatsby": "next",
8+
"gatsby-plugin-mailchimp": "https://github.com/benjaminhoffman/gatsby-plugin-mailchimp.git#gatsby-v2",
9+
"gatsby-plugin-manifest": "next",
10+
"gatsby-plugin-offline": "next",
11+
"gatsby-plugin-react-helmet": "next",
12+
"react": "^16.4.2",
13+
"react-dom": "^16.4.2",
14+
"react-helmet": "^5.2.0"
15+
},
16+
"keywords": [
17+
"gatsby"
18+
],
19+
"license": "MIT",
20+
"scripts": {
21+
"build": "gatsby build",
22+
"develop": "gatsby develop",
23+
"serve": "gatsby serve",
24+
"format": "prettier --write '**/*.js'",
25+
"test": "echo \"Error: no test specified\" && exit 1"
26+
},
27+
"devDependencies": {
28+
"prettier": "^1.14.2"
29+
},
30+
"repository": {
31+
"type": "git",
32+
"url": "https://github.com/gatsbyjs/gatsby-starter-default"
33+
}
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React from 'react'
2+
import { Link } from 'gatsby'
3+
4+
const Header = ({ siteTitle }) => (
5+
<div
6+
style={{
7+
background: 'rebeccapurple',
8+
marginBottom: '1.45rem',
9+
}}
10+
>
11+
<div
12+
style={{
13+
margin: '0 auto',
14+
maxWidth: 960,
15+
padding: '1.45rem 1.0875rem',
16+
}}
17+
>
18+
<h1 style={{ margin: 0 }}>
19+
<Link
20+
to="/"
21+
style={{
22+
color: 'white',
23+
textDecoration: 'none',
24+
}}
25+
>
26+
{siteTitle}
27+
</Link>
28+
</h1>
29+
</div>
30+
</div>
31+
)
32+
33+
export default Header

0 commit comments

Comments
 (0)