-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml.js
72 lines (68 loc) · 1.88 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import React from "react"
import DocumentTitle from "react-document-title"
//import { prefixLink } from 'gatsby-helpers'
import { GoogleFont, TypographyStyle } from "react-typography"
import typography from "./utils/typography"
import logo from "!file-loader!./images/logo.png"
let stylesStr
if (process.env.NODE_ENV === `production`) {
try {
stylesStr = require("!raw-loader!./public/styles.css")
} catch (e) {
console.log(e)
}
}
module.exports = React.createClass({
render() {
const title = DocumentTitle.rewind()
let css
if (process.env.NODE_ENV === `production`) {
css = (
<style
id="gatsby-inlined-css"
dangerouslySetInnerHTML={{ __html: stylesStr }}
/>
)
}
return (
<html lang="en">
<head>
<link
rel="preload"
href={`/static/space-mono-latin-700.eadcd2d5.woff2`}
as="font"
crossOrigin
/>
<link
rel="preload"
href={`/static/space-mono-latin-400.a8338881.woff2`}
as="font"
crossOrigin
/>
{this.props.headComponents}
<meta charSet="utf-8" />
<meta
name="description"
content="Gatsbygram: A clone of Instagram built with GatsbyJS"
/>
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<link rel="icon" type="image/png" href={logo} />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>Gatsbygram</title>
<TypographyStyle typography={typography} />
{css}
</head>
<body>
<div
id="react-mount"
dangerouslySetInnerHTML={{ __html: this.props.body }}
/>
{this.props.postBodyComponents}
</body>
</html>
)
},
})