Use gatsby-plugin-typography and remove the html.js

This commit is contained in:
Kyle Mathews 2017-08-04 19:10:53 -07:00
parent 8f03c8589e
commit 33ed103d69
5 changed files with 9068 additions and 53 deletions

View file

@ -1,50 +0,0 @@
import React from 'react'
import { TypographyStyle } from 'react-typography'
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)
}
}
export default class HTML extends React.Component {
render() {
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>
<body>
<div
id="___gatsby"
dangerouslySetInnerHTML={{ __html: this.props.body }}
/>
{this.props.postBodyComponents}
</body>
</html>
)
}
}