Skip to content

Commit bb4b5b4

Browse files
npalmJeroenKnoops
authored andcommitted
upgrading to gatsby3
1 parent 41b4cfa commit bb4b5b4

File tree

6 files changed

+7743
-9133
lines changed

6 files changed

+7743
-9133
lines changed

gatsby-config.js

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ module.exports = {
6565
trackingId: config.googleAnalyticsId,
6666
},
6767
},
68-
`gatsby-plugin-feed`,
6968
`gatsby-plugin-offline`,
7069
`gatsby-plugin-styled-components`,
7170
`gatsby-plugin-react-helmet`,
@@ -81,5 +80,64 @@ module.exports = {
8180
icon: config.icon,
8281
}
8382
},
83+
84+
{
85+
resolve: `gatsby-plugin-feed`,
86+
options: {
87+
query: `
88+
{
89+
site {
90+
siteMetadata {
91+
title
92+
description
93+
siteUrl
94+
site_url: siteUrl
95+
}
96+
}
97+
}
98+
`,
99+
feeds: [
100+
{
101+
serialize: ({ query: { site, allMarkdownRemark } }) => {
102+
return allMarkdownRemark.nodes.map(node => {
103+
return Object.assign({}, node.frontmatter, {
104+
description: node.excerpt,
105+
date: node.frontmatter.date,
106+
url: site.siteMetadata.siteUrl + node.fields.slug,
107+
guid: site.siteMetadata.siteUrl + node.fields.slug,
108+
custom_elements: [{ "content:encoded": node.html }],
109+
})
110+
})
111+
},
112+
query: `
113+
{
114+
allMarkdownRemark(
115+
sort: { order: DESC, fields: [frontmatter___date] },
116+
) {
117+
nodes {
118+
excerpt
119+
html
120+
fields {
121+
slug
122+
}
123+
frontmatter {
124+
title
125+
date
126+
}
127+
}
128+
}
129+
}
130+
`,
131+
output: "/rss.xml",
132+
title: "Your Site's RSS Feed",
133+
// optional configuration to insert feed reference in pages:
134+
// if `string` is used, it will be used to create RegExp and then test if pathname of
135+
// current page satisfied this regular expression;
136+
// if not provided or `undefined`, all pages will have feed reference inserted
137+
match: "^/blog/",
138+
},
139+
],
140+
},
141+
},
84142
],
85143
}

package.json

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,46 @@
44
"version": "0.0.0-development",
55
"author": "Niek, Jeroen",
66
"dependencies": {
7-
"babel-plugin-styled-components": "^1.8.0",
8-
"core-js": "^2.5.7",
9-
"disqus-react": "^1.0.5",
10-
"gatsby": "^2.4.2",
11-
"gatsby-plugin-feed": "2.2.0",
12-
"gatsby-plugin-google-analytics": "2.0.19",
13-
"gatsby-plugin-manifest": "^2.0.12",
14-
"gatsby-plugin-offline": "^2.0.20",
15-
"gatsby-plugin-react-helmet": "^3.0.12",
16-
"gatsby-plugin-sharp": "^2.0.22",
17-
"gatsby-plugin-styled-components": "^3.0.4",
18-
"gatsby-remark-autolink-headers": "^2.0.12",
19-
"gatsby-remark-copy-linked-files": "^2.0.9",
20-
"gatsby-remark-emoji": "^0.0.2",
21-
"gatsby-remark-images": "^3.0.5",
7+
"babel-plugin-styled-components": "^2.0.2",
8+
"core-js": "^3.20.0",
9+
"disqus-react": "^1.1.2",
10+
"gatsby": "^4.4.0",
11+
"gatsby-plugin-feed": "^4.4.0",
12+
"gatsby-plugin-google-analytics": "^4.4.0",
13+
"gatsby-plugin-manifest": "^4.4.0",
14+
"gatsby-plugin-offline": "^5.4.0",
15+
"gatsby-plugin-react-helmet": "^5.4.0",
16+
"gatsby-plugin-sharp": "^4.4.0",
17+
"gatsby-plugin-styled-components": "^5.4.0",
18+
"gatsby-remark-autolink-headers": "^5.4.0",
19+
"gatsby-remark-copy-linked-files": "^5.4.0",
20+
"gatsby-remark-emoji": "^0.0.3",
21+
"gatsby-remark-images": "^6.4.0",
2222
"gatsby-remark-numbered-footnotes": "^1.0.1",
23-
"gatsby-remark-prismjs": "^3.2.4",
24-
"gatsby-remark-responsive-iframe": "^2.0.9",
25-
"gatsby-remark-smartypants": "^2.0.8",
26-
"gatsby-source-filesystem": "^2.0.23",
27-
"gatsby-transformer-remark": "^2.3.0",
28-
"gatsby-transformer-sharp": "^2.1.14",
29-
"lodash": "^4.17.5",
30-
"prismjs": "^1.15.0",
31-
"react": "^16.8.3",
32-
"react-burger-menu": "^2.6.10",
33-
"react-dom": "^16.8.3",
34-
"react-helmet": "^5.2.0",
35-
"react-icons": "^3.6.1",
36-
"styled-components": "4.3.2"
23+
"gatsby-remark-prismjs": "^6.4.0",
24+
"gatsby-remark-responsive-iframe": "^5.4.0",
25+
"gatsby-remark-smartypants": "^5.4.0",
26+
"gatsby-source-filesystem": "^4.4.0",
27+
"gatsby-transformer-remark": "^5.4.0",
28+
"gatsby-transformer-sharp": "^4.4.0",
29+
"lodash": "^4.17.21",
30+
"prismjs": "^1.25.0",
31+
"react": "^17.0.2",
32+
"react-burger-menu": "^3.0.6",
33+
"react-dom": "^17.0.2",
34+
"react-helmet": "^6.1.0",
35+
"react-icons": "^4.3.1",
36+
"styled-components": "5.3.3"
3737
},
3838
"devDependencies": {
39-
"eslint": "^6.0.1",
40-
"eslint-plugin-react": "^7.7.0",
41-
"gatsby-cli": "^2.5.12",
42-
"now": "^19.0.1",
43-
"prettier": "^1.12.0",
44-
"puppeteer": "^1.9.0",
45-
"semantic-release": "^15.13.12",
46-
"yaml": "^1.6.0"
39+
"eslint": "^8.4.1",
40+
"eslint-plugin-react": "^7.27.1",
41+
"gatsby-cli": "^4.4.0",
42+
"now": "^21.0.1",
43+
"prettier": "^2.5.1",
44+
"puppeteer": "^13.0.0",
45+
"semantic-release": "^18.0.1",
46+
"yaml": "^1.10.2"
4747
},
4848
"homepage": "https://040code.github.io",
4949
"keywords": [

src/components/Hero.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class Hero extends React.Component {
111111
authors.map((author, i) => {
112112
return (
113113
<Fragment key={`author-list-${i}`}>
114-
<AuthorLink to={`authors/${author}`}>{author}</AuthorLink>
114+
<AuthorLink to={`/authors/${author}`}>{author}</AuthorLink>
115115
{i < authors.length - 1 ? ' ' : ''}
116116
</Fragment>
117117
)

src/components/PostsListItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class PostsListItem extends React.Component {
6969
<Post>
7070
<PostHeader>
7171
<h2>
72-
<PostTitleLink to={slug}>
72+
<PostTitleLink to={`/${slug}`}>
7373
{siteConfig.multilangPosts && <Flag language={language} />}
7474
{title}
7575
</PostTitleLink>

src/components/TagList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class TagList extends React.Component {
3939
{tags.map((tag, i) => {
4040
return (
4141
<Fragment key={`tag-list-${i}`}>
42-
<TagListItem className="w3-round-size" to={`tags/${tag}`}>
42+
<TagListItem className="w3-round-size" to={`/tags/${tag}`}>
4343
{tag}
4444
</TagListItem>
4545
{i < tags.length - 1 ? ' ' : ''}

0 commit comments

Comments
 (0)