7
7
8
8
import * as React from "react"
9
9
import PropTypes from "prop-types"
10
- import { Helmet } from "react-helmet"
11
10
import { useStaticQuery , graphql } from "gatsby"
12
11
13
- const Seo = ( { description, lang, meta , title } ) => {
12
+ const Seo = ( { description, lang, title , children } ) => {
14
13
const { site } = useStaticQuery (
15
14
graphql `
16
15
query {
@@ -31,60 +30,30 @@ const Seo = ({ description, lang, meta, title }) => {
31
30
const defaultTitle = site . siteMetadata ?. title
32
31
33
32
return (
34
- < Helmet
35
- htmlAttributes = { {
36
- lang,
37
- } }
38
- title = { title }
39
- titleTemplate = { defaultTitle ? `%s | ${ defaultTitle } ` : null }
40
- meta = { [
41
- {
42
- name : `description` ,
43
- content : metaDescription ,
44
- } ,
45
- {
46
- property : `og:title` ,
47
- content : title ,
48
- } ,
49
- {
50
- property : `og:description` ,
51
- content : metaDescription ,
52
- } ,
53
- {
54
- property : `og:type` ,
55
- content : `website` ,
56
- } ,
57
- {
58
- name : `twitter:card` ,
59
- content : `summary` ,
60
- } ,
61
- {
62
- name : `twitter:creator` ,
63
- content : site . siteMetadata ?. social ?. twitter || `` ,
64
- } ,
65
- {
66
- name : `twitter:title` ,
67
- content : title ,
68
- } ,
69
- {
70
- name : `twitter:description` ,
71
- content : metaDescription ,
72
- } ,
73
- ] . concat ( meta ) }
74
- />
33
+ < >
34
+ < title > { defaultTitle ? `${ title } | ${ defaultTitle } ` : title } </ title >
35
+ < meta name = "description" content = { metaDescription } />
36
+ < meta property = "og:title" content = { title } />
37
+ < meta property = "og:description" content = { metaDescription } />
38
+ < meta property = "og:type" content = "website" />
39
+ < meta name = "twitter:card" content = "summary" />
40
+ < meta
41
+ name = "twitter:creator"
42
+ content = { site . siteMetadata ?. social ?. twitter || `` }
43
+ />
44
+ < meta name = "twitter:title" content = { title } />
45
+ < meta name = "twitter:description" content = { metaDescription } />
46
+ { children }
47
+ </ >
75
48
)
76
49
}
77
50
78
51
Seo . defaultProps = {
79
- lang : `en` ,
80
- meta : [ ] ,
81
52
description : `` ,
82
53
}
83
54
84
55
Seo . propTypes = {
85
56
description : PropTypes . string ,
86
- lang : PropTypes . string ,
87
- meta : PropTypes . arrayOf ( PropTypes . object ) ,
88
57
title : PropTypes . string . isRequired ,
89
58
}
90
59
0 commit comments