1
- import React from 'react'
2
- import PropTypes from 'prop-types'
3
- import Helmet from 'react-helmet'
4
- import { StaticQuery , graphql } from 'gatsby'
1
+ import React from "react" ;
2
+ import PropTypes from "prop-types" ;
3
+ import Helmet from "react-helmet" ;
4
+ import { StaticQuery , graphql } from "gatsby" ;
5
+
6
+ import ogImage from "../images/og-frame.png" ;
5
7
6
8
function SEO ( { description, lang, meta, keywords, title } ) {
7
9
return (
8
10
< StaticQuery
9
11
query = { detailsQuery }
10
12
render = { data => {
11
13
const metaDescription =
12
- description || data . site . siteMetadata . description
14
+ description || data . site . siteMetadata . description ;
13
15
return (
14
16
< Helmet
15
17
htmlAttributes = { {
@@ -50,6 +52,10 @@ function SEO({ description, lang, meta, keywords, title }) {
50
52
name : `twitter:description` ,
51
53
content : metaDescription ,
52
54
} ,
55
+ {
56
+ name : `og:image` ,
57
+ content : `https://www.reactdecal.org${ ogImage } ` ,
58
+ } ,
53
59
]
54
60
. concat (
55
61
keywords . length > 0
@@ -60,30 +66,30 @@ function SEO({ description, lang, meta, keywords, title }) {
60
66
: [ ]
61
67
)
62
68
. concat ( meta ) }
63
- >
64
- < link rel = "stylesheet" href = "https://use.typekit.net/ffz7vta.css" />
65
- </ Helmet >
66
- )
69
+ >
70
+ < link rel = "stylesheet" href = "https://use.typekit.net/ffz7vta.css" />
71
+ </ Helmet >
72
+ ) ;
67
73
} }
68
74
/>
69
- )
75
+ ) ;
70
76
}
71
77
72
78
SEO . defaultProps = {
73
79
lang : `en` ,
74
80
meta : [ ] ,
75
81
keywords : [ ] ,
76
- }
82
+ } ;
77
83
78
84
SEO . propTypes = {
79
85
description : PropTypes . string ,
80
86
lang : PropTypes . string ,
81
87
meta : PropTypes . array ,
82
88
keywords : PropTypes . arrayOf ( PropTypes . string ) ,
83
89
title : PropTypes . string . isRequired ,
84
- }
90
+ } ;
85
91
86
- export default SEO
92
+ export default SEO ;
87
93
88
94
const detailsQuery = graphql `
89
95
query DefaultSEOQuery {
@@ -95,4 +101,4 @@ const detailsQuery = graphql`
95
101
}
96
102
}
97
103
}
98
- `
104
+ ` ;
0 commit comments