Update for latest canary + prettier
This commit is contained in:
parent
b7d1dbf4e1
commit
b23a664df6
20 changed files with 436 additions and 314 deletions
47
src/html.js
Normal file
47
src/html.js
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import React from 'react'
|
||||
import { TypographyStyle } from 'react-typography'
|
||||
import Helmet from 'react-helmet'
|
||||
|
||||
import typography from './utils/typography'
|
||||
|
||||
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 head = Helmet.rewind()
|
||||
let css
|
||||
if (process.env.NODE_ENV === `production`) {
|
||||
css = <style id="gatsby-inlined-css" dangerouslySetInnerHTML={{ __html: stylesStr }} />
|
||||
}
|
||||
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charSet="utf-8" />
|
||||
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0"
|
||||
/>
|
||||
{this.props.headComponents}
|
||||
<TypographyStyle typography={typography} />
|
||||
{css}
|
||||
{head.title.toComponent()}
|
||||
{head.meta.toComponent()}
|
||||
{head.link.toComponent()}
|
||||
</head>
|
||||
<body>
|
||||
<div id="react-mount" dangerouslySetInnerHTML={{ __html: this.props.body }} />
|
||||
{this.props.postBodyComponents}
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
},
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue