Skip to content

Commit 57d7e16

Browse files
Zach Lysobeyzachlysobey
authored andcommitted
(chore) update to Gatsby 2.x
1 parent aa06ff7 commit 57d7e16

File tree

10 files changed

+16379
-10885
lines changed

10 files changed

+16379
-10885
lines changed

package-lock.json

Lines changed: 16261 additions & 10785 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
"version": "1.0.0",
55
"author": "Zach Lysobey <zlysobey+dev@gmail.com>",
66
"dependencies": {
7-
"gatsby": "^1.9.247",
8-
"gatsby-link": "^1.6.40",
9-
"gatsby-plugin-react-helmet": "^2.0.10",
10-
"gatsby-remark-prismjs": "^3.0.0",
11-
"gatsby-source-filesystem": "^1.5.39",
12-
"gatsby-transformer-remark": "^1.7.44",
13-
"prismjs": "^1.15.0",
14-
"react-helmet": "^5.2.0"
7+
"gatsby": "^2.14.6",
8+
"gatsby-link": "^2.2.10",
9+
"gatsby-plugin-react-helmet": "^3.1.5",
10+
"gatsby-remark-prismjs": "^3.3.9",
11+
"gatsby-source-filesystem": "^2.1.18",
12+
"gatsby-transformer-remark": "^2.6.19",
13+
"prismjs": "^1.17.1",
14+
"react": "^16.9.0",
15+
"react-dom": "^16.9.0",
16+
"react-helmet": "^5.2.1"
1517
},
1618
"keywords": [
1719
"gatsby",
@@ -33,9 +35,9 @@
3335
]
3436
},
3537
"devDependencies": {
36-
"husky": "^1.0.0",
37-
"lint-staged": "^7.2.0",
38-
"prettier": "^1.12.0"
38+
"husky": "^3.0.4",
39+
"lint-staged": "^9.2.5",
40+
"prettier": "^1.18.2"
3941
},
4042
"repository": {
4143
"type": "git",

src/components/layout.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import React from 'react'
2+
import PropTypes from 'prop-types'
3+
import { StaticQuery, graphql } from 'gatsby'
4+
import Helmet from 'react-helmet'
5+
6+
import Header from './header'
7+
8+
import './layout.css'
9+
10+
// import 'prismjs/themes/prism.css'
11+
// import 'prismjs/themes/prism-tomorrow.css'
12+
// import 'prismjs/themes/prism-coy.css'
13+
// import 'prismjs/themes/prism-dark.css'
14+
// import 'prismjs/themes/prism-funky.css'
15+
import 'prismjs/themes/prism-okaidia.css'
16+
// import 'prismjs/themes/prism-solarizedlight.css'
17+
18+
const Layout = ({ children, data }) => (
19+
<StaticQuery
20+
query={graphql`
21+
query SiteTitleQuery {
22+
site {
23+
siteMetadata {
24+
title
25+
}
26+
}
27+
}
28+
`}
29+
render={(data) => (
30+
<>
31+
<Helmet
32+
title={data.site.siteMetadata.title}
33+
meta={[
34+
{ name: 'description', content: 'Sample' },
35+
{ name: 'keywords', content: 'sample, something' },
36+
]}
37+
/>
38+
<Header siteTitle={data.site.siteMetadata.title} />
39+
<div
40+
style={{
41+
margin: '0 auto',
42+
maxWidth: 960,
43+
padding: '0px 1.0875rem 1.45rem',
44+
paddingTop: 0,
45+
}}
46+
>
47+
{children}
48+
</div>
49+
</>
50+
)}
51+
/>
52+
)
53+
54+
Layout.propTypes = {
55+
children: PropTypes.element,
56+
}
57+
58+
export default Layout

src/layouts/index.js

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/pages/blog.js

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
import React from 'react'
22
import Link from 'gatsby-link'
33

4+
import Layout from '../components/layout'
5+
46
export default function Blog({ data }) {
57
const { edges: posts } = data.allMarkdownRemark
68
return (
7-
<div className="blog-posts">
8-
{posts
9-
.filter((post) => post.node.frontmatter.title.length > 0)
10-
.map(({ node: post }) => {
11-
return (
12-
<div className="blog-post-preview" key={post.id}>
13-
<h2>
14-
<small>{post.frontmatter.date}</small>{' '}
15-
<Link to={post.frontmatter.path}>
16-
{post.frontmatter.title}
17-
</Link>
18-
</h2>
19-
<p>{post.excerpt}</p>
20-
</div>
21-
)
22-
})}
23-
</div>
9+
<Layout>
10+
<div className="blog-posts">
11+
{posts
12+
.filter((post) => post.node.frontmatter.title.length > 0)
13+
.map(({ node: post }) => {
14+
return (
15+
<div className="blog-post-preview" key={post.id}>
16+
<h2>
17+
<small>{post.frontmatter.date}</small>{' '}
18+
<Link to={post.frontmatter.path}>
19+
{post.frontmatter.title}
20+
</Link>
21+
</h2>
22+
<p>{post.excerpt}</p>
23+
</div>
24+
)
25+
})}
26+
</div>
27+
</Layout>
2428
)
2529
}
2630

src/pages/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import React from 'react'
22
import Link from 'gatsby-link'
33

4+
import Layout from '../components/layout'
5+
46
export default () => (
5-
<div>
7+
<Layout>
68
<h2>My new home on the Internet</h2>
79

810
<p>Playing around with creating a new site using Gatsby.js</p>
@@ -18,5 +20,5 @@ export default () => (
1820
<Link to="/blog/">Blog</Link>
1921
</li>
2022
</ul>
21-
</div>
23+
</Layout>
2224
)

src/pages/music.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import React from 'react'
22
import Link from 'gatsby-link'
33

4+
import Layout from '../components/layout'
45
import { YoutubePosts } from '../components/youtube-posts'
56
import { Bands } from '../components/bands'
67

78
export default () => (
8-
<div>
9+
<Layout>
910
<h2>Music</h2>
1011

1112
<Bands />
1213

1314
<YoutubePosts />
1415

1516
<Link to="/">back home</Link>
16-
</div>
17+
</Layout>
1718
)

src/pages/programming.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import React from 'react'
22
import Link from 'gatsby-link'
33

4+
import Layout from '../components/layout'
45
import { ExternalArticles } from '../components/external-articles'
56

67
export default () => (
7-
<div>
8+
<Layout>
89
<h2>Programming</h2>
910

1011
<ExternalArticles />
1112

1213
<Link to="/">back home</Link>
13-
</div>
14+
</Layout>
1415
)

src/templates/blog-post.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
import React from 'react'
22
import Helmet from 'react-helmet'
33

4+
import Layout from '../components/layout'
5+
46
export default function Template({ data }) {
57
const { markdownRemark: post } = data
68
return (
7-
<div className="blog-post-container">
8-
<Helmet title={`Zach Lysobey - ${post.frontmatter.title}`} />
9-
<div className="blog-post">
10-
<h2>
11-
<small>{post.frontmatter.date}</small>{' '}
12-
{post.frontmatter.title}
13-
</h2>
14-
<div
15-
className="blog-post-content"
16-
dangerouslySetInnerHTML={{ __html: post.html }}
17-
/>
9+
<Layout>
10+
<div className="blog-post-container">
11+
<Helmet title={`Zach Lysobey - ${post.frontmatter.title}`} />
12+
<div className="blog-post">
13+
<h2>
14+
<small>{post.frontmatter.date}</small>{' '}
15+
{post.frontmatter.title}
16+
</h2>
17+
<div
18+
className="blog-post-content"
19+
dangerouslySetInnerHTML={{ __html: post.html }}
20+
/>
21+
</div>
1822
</div>
19-
</div>
23+
</Layout>
2024
)
2125
}
2226

0 commit comments

Comments
 (0)