forked from Insoumis/opif
-
Notifications
You must be signed in to change notification settings - Fork 0
/
html.js
50 lines (40 loc) · 1.73 KB
/
html.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
40
41
42
43
44
45
46
47
48
49
50
import React from 'react';
import { prefixLink } from 'gatsby-helpers';
import Helmet from 'react-helmet';
const BUILD_TIME = new Date().getTime();
const HTML = ({ body }) => {
const head = Helmet.rewind();
let css;
if (process.env.NODE_ENV === 'production') {
css = <style dangerouslySetInnerHTML={{ __html: require('!raw!./public/styles.css') }} />;
}
return (
<html lang="fr">
<head>
<meta charSet="utf-8" />
<meta httpEquiv="x-ua-compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
{head.title.toComponent()}
{head.meta.toComponent()}
<meta property="og:site_name" content="OPIF.info" />
<meta property="og:locale" content="fr_FR" />
<meta property="og:type" content="website" />
<meta name="twitter:site" content="@InstitutOpif" />
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700|Roboto:400,400i" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossOrigin="anonymous" />
<link rel="icon" type="image/png" href="/favicon.png" />
{css}
</head>
<body>
<div id="react-mount" dangerouslySetInnerHTML={{ __html: body }} />
<script src={prefixLink(`/bundle.js?t=${BUILD_TIME}`)} />
<script async src="//platform.twitter.com/widgets.js" charSet="utf-8"></script>
<script async src="https://cdn.emailjs.com/dist/email.min.js"></script>
</body>
</html>
);
};
HTML.propTypes = {
body: React.PropTypes.string,
};
export default HTML;