forked from npm/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhead.js
More file actions
27 lines (23 loc) · 819 Bytes
/
head.js
File metadata and controls
27 lines (23 loc) · 819 Bytes
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
import React from 'react'
import Helmet from 'react-helmet'
import useSiteMetdata from '../use-site-metadata'
function Head (props) {
const siteMetadata = useSiteMetdata()
const title = props.title
? `${props.title} | ${siteMetadata.title}`
: siteMetadata.title
const description = props.description || siteMetadata.description
const lang = props.lang || siteMetadata.lang
return (
<Helmet>
<title>{title}</title>
<meta name="description" content={description} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:image" content={siteMetadata.imageUrl} />
<meta property="twitter:card" content="summary_large_image" />
<html lang={lang} />
</Helmet>
)
}
export default Head