Skip to content

Commit ac2de08

Browse files
committed
refactor pages to use the Gatsby Head API
1 parent 6c6cbf0 commit ac2de08

File tree

8 files changed

+6109
-4633
lines changed

8 files changed

+6109
-4633
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dependencies": {
1818
"@mdx-js/mdx": "^1.6.22",
1919
"@mdx-js/react": "^1.6.22",
20-
"gatsby": "^4.0.0",
20+
"gatsby": "^4.19.0",
2121
"gatsby-plugin-image": "^2.0.0",
2222
"gatsby-plugin-mdx": "^3.0.0",
2323
"gatsby-plugin-sharp": "^4.0.0",

src/components/layout.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const Layout = ({ pageTitle, children }) => {
2222

2323
return (
2424
<div className={container}>
25-
<title>{pageTitle} | {data.site.siteMetadata.title}</title>
2625
<header className={siteTitle}>{data.site.siteMetadata.title}</header>
2726
<nav>
2827
<ul className={navLinks}>

src/pages/404.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const codeStyles = {
2828
const NotFoundPage = () => {
2929
return (
3030
<main style={pageStyles}>
31-
<title>Not found</title>
3231
<h1 style={headingStyles}>Page not found</h1>
3332
<p style={paragraphStyles}>
3433
Sorry{" "}
@@ -51,4 +50,6 @@ const NotFoundPage = () => {
5150
)
5251
}
5352

53+
export const Head = () => <title>Not found</title>
54+
5455
export default NotFoundPage

src/pages/about.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ const AboutPage = () => {
99
)
1010
}
1111

12+
export const Head = () => <title>About Me</title>
13+
1214
export default AboutPage

src/pages/blog/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ export const query = graphql`
3535
}
3636
}
3737
`
38+
export const Head = () => <title>My Blog Posts</title>
3839

3940
export default BlogPage

src/pages/blog/{mdx.slug}.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,6 @@ export const query = graphql`
4747
}
4848
`
4949

50+
export const Head = ({ data }) => <title>{data.mdx.frontmatter.title}</title>
51+
5052
export default BlogPost

src/pages/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ const IndexPage = () => {
1414
)
1515
}
1616

17+
export const Head = () => <title>Home Page</title>
18+
1719
export default IndexPage

0 commit comments

Comments
 (0)