forked from apollographql/gatsby-theme-apollo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
seo.js
34 lines (31 loc) · 1.03 KB
/
seo.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
import PropTypes from 'prop-types';
import React from 'react';
import {Helmet} from 'react-helmet';
export default function SEO(props) {
const {title, description, siteName, twitterCard, children, favicon} = props;
return (
<Helmet>
<title>{title}</title>
<meta property="og:title" content={title} />
<meta property="og:site_name" content={siteName} />
<meta property="og:description" content={description} />
<meta name="twitter:card" content={twitterCard} />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
<link rel="icon" href={favicon} />
{children}
</Helmet>
);
}
SEO.propTypes = {
title: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
siteName: PropTypes.string.isRequired,
twitterCard: PropTypes.string,
children: PropTypes.node,
favicon: PropTypes.string
};
SEO.defaultProps = {
twitterCard: 'summary',
favicon: 'https://developers.unchained.shop/static/img/favicon.ico'
};