-
Notifications
You must be signed in to change notification settings - Fork 10.3k
/
index.js
39 lines (37 loc) · 1.33 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React from "react"
import Helmet from "react-helmet"
import moment from "moment"
class HelmetBlock extends React.Component {
render() {
const frontmatter = this.props
return (
<div>
<Helmet>
<title>{frontmatter.title}</title>
<meta name="description" content={frontmatter.description} />
<meta
property="og:url"
content={`https://www.jacobbolda.com/${frontmatter.path}`}
/>
<meta property="og:description" content={frontmatter.description} />
<meta property="og:type" content="article" />
<meta property="og:article:author" content="Jacob Bolda" />
<meta
property="og:article:published_time"
content={moment(frontmatter.written, `YYYY-MM-DD`)}
/>
<meta
property="og:article:modified_time"
content={moment(frontmatter.updated, `YYYY-MM-DD`)}
/>
<meta property="og:article:tag" content={frontmatter.category} />
<meta name="twitter:label1" content="Category" />
<meta name="twitter:data1" content={frontmatter.category} />
<meta name="twitter:label2" content="Written" />
<meta name="twitter:data2" content={frontmatter.written} />
</Helmet>
</div>
)
}
}
export default HelmetBlock