File tree Expand file tree Collapse file tree 5 files changed +122
-11
lines changed Expand file tree Collapse file tree 5 files changed +122
-11
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import Layout from '../layouts' ;
3
+ import { Helmet } from 'react-helmet' ;
3
4
4
- const NotFoundPage = ( ) => (
5
- < Layout >
6
- < div >
7
- < h1 > NOT FOUND</ h1 >
8
- < p > You just hit a route that doesn't exist... the sadness.</ p >
9
- </ div >
10
- </ Layout >
11
- ) ;
5
+ const NotFoundPage = ( { data } ) => {
6
+ const { siteMetadata } = data . site ;
7
+ const title = `Page Not Found! - ${ siteMetadata . title } ` ;
8
+
9
+ return (
10
+ < Layout >
11
+ < Helmet >
12
+ < title > { title } </ title >
13
+
14
+ < meta property = "og:title" content = { title } />
15
+ < meta
16
+ property = "og:description"
17
+ content = "A brief introduction to my background"
18
+ />
19
+ </ Helmet >
20
+
21
+ < div >
22
+ < h1 > Page Not Found</ h1 >
23
+ < p > Please check the url and try again.</ p >
24
+ </ div >
25
+ </ Layout >
26
+ ) ;
27
+ } ;
12
28
13
29
export default NotFoundPage ;
30
+
31
+ export const pageQuery = graphql `
32
+ query NotFoundPage {
33
+ site {
34
+ siteMetadata {
35
+ title
36
+ }
37
+ }
38
+ }
39
+ ` ;
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import me from '../images/me.jpg';
4
4
import banner from '../images/about-me-banner.jpg' ;
5
5
import { OutboundLink } from 'gatsby-plugin-google-analytics' ;
6
6
import styled from 'styled-components' ;
7
+ import { Helmet } from 'react-helmet' ;
7
8
8
9
const AboutMeHeader = styled . div `
9
10
float: left;
@@ -71,9 +72,22 @@ const BannerImage = styled.img`
71
72
}
72
73
` ;
73
74
74
- export default function About ( ) {
75
+ export default function About ( { data } ) {
76
+ const { siteMetadata } = data . site ;
77
+ const title = `About Me - ${ siteMetadata . title } ` ;
78
+
75
79
return (
76
80
< Layout >
81
+ < Helmet >
82
+ < title > { title } </ title >
83
+
84
+ < meta property = "og:title" content = { title } />
85
+ < meta
86
+ property = "og:description"
87
+ content = "A brief introduction to my background"
88
+ />
89
+ </ Helmet >
90
+
77
91
< BannerImage src = { banner } alt = "Me standing on stage giving a talk" />
78
92
79
93
< AboutMeHeader >
@@ -182,3 +196,13 @@ export default function About() {
182
196
</ Layout >
183
197
) ;
184
198
}
199
+
200
+ export const pageQuery = graphql `
201
+ query AboutPage {
202
+ site {
203
+ siteMetadata {
204
+ title
205
+ }
206
+ }
207
+ }
208
+ ` ;
Original file line number Diff line number Diff line change @@ -2,11 +2,21 @@ import React from 'react';
2
2
import { graphql } from 'gatsby' ;
3
3
import Link from 'gatsby-link' ;
4
4
import Layout from '../layouts' ;
5
+ import { Helmet } from 'react-helmet' ;
5
6
6
7
export default function Index ( { data } ) {
8
+ const { siteMetadata } = data . site ;
9
+ const title = `Blog - ${ siteMetadata . title } ` ;
10
+
7
11
const { edges : posts } = data . allMarkdownRemark ;
8
12
return (
9
13
< Layout >
14
+ < Helmet >
15
+ < title > { title } </ title >
16
+
17
+ < meta property = "og:title" content = { title } />
18
+ </ Helmet >
19
+
10
20
{ posts
11
21
. filter ( post => post . node . frontmatter . title . length > 0 )
12
22
. map ( ( { node : post } ) => {
@@ -39,5 +49,11 @@ export const pageQuery = graphql`
39
49
}
40
50
}
41
51
}
52
+
53
+ site {
54
+ siteMetadata {
55
+ title
56
+ }
57
+ }
42
58
}
43
59
` ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import Layout from '../layouts' ;
3
3
import { OutboundLink } from 'gatsby-plugin-google-analytics' ;
4
+ import { Helmet } from 'react-helmet' ;
5
+
6
+ export default function Projects ( { data } ) {
7
+ const { siteMetadata } = data . site ;
8
+ const title = `Projects - ${ siteMetadata . title } ` ;
4
9
5
- export default function Projects ( ) {
6
10
return (
7
11
< Layout >
12
+ < Helmet >
13
+ < title > { title } </ title >
14
+
15
+ < meta property = "og:title" content = { title } />
16
+ < meta
17
+ property = "og:description"
18
+ content = "Projects I'm currently working on"
19
+ />
20
+ </ Helmet >
21
+
8
22
< h2 style = { { fontSize : '2em' } } > Projects</ h2 >
9
23
10
24
< section >
@@ -157,3 +171,13 @@ export default function Projects() {
157
171
</ Layout >
158
172
) ;
159
173
}
174
+
175
+ export const pageQuery = graphql `
176
+ query ProjectsPage {
177
+ site {
178
+ siteMetadata {
179
+ title
180
+ }
181
+ }
182
+ }
183
+ ` ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import Layout from '../layouts' ;
3
3
import { OutboundLink } from 'gatsby-plugin-google-analytics' ;
4
+ import { Helmet } from 'react-helmet' ;
5
+
6
+ export default function Talks ( { data } ) {
7
+ const { siteMetadata } = data . site ;
8
+ const title = `Talks - ${ siteMetadata . title } ` ;
4
9
5
- export default function Talks ( ) {
6
10
return (
7
11
< Layout >
12
+ < Helmet >
13
+ < title > { title } </ title >
14
+
15
+ < meta property = "og:title" content = { title } />
16
+ < meta property = "og:description" content = "A list of talks I've given" />
17
+ </ Helmet >
18
+
8
19
< h2 style = { { fontSize : '2em' } } > Talks</ h2 >
9
20
10
21
< ul >
@@ -82,3 +93,13 @@ export default function Talks() {
82
93
</ Layout >
83
94
) ;
84
95
}
96
+
97
+ export const pageQuery = graphql `
98
+ query TalksPage {
99
+ site {
100
+ siteMetadata {
101
+ title
102
+ }
103
+ }
104
+ }
105
+ ` ;
You can’t perform that action at this time.
0 commit comments