Fix path to styles.css

This commit is contained in:
Kyle Mathews 2017-05-03 12:44:45 -07:00
parent 532d70bcb9
commit 1d2329c1c9

View file

@ -1,13 +1,13 @@
import React from 'react'
import { TypographyStyle } from 'react-typography'
import Helmet from 'react-helmet'
import React from "react"
import { TypographyStyle } from "react-typography"
import Helmet from "react-helmet"
import typography from './utils/typography'
import typography from "./utils/typography"
let stylesStr
if (process.env.NODE_ENV === `production`) {
try {
stylesStr = require(`!raw-loader!./public/styles.css`)
stylesStr = require(`!raw-loader!../public/styles.css`)
} catch (e) {
console.log(e)
}
@ -18,7 +18,12 @@ module.exports = React.createClass({
const head = Helmet.rewind()
let css
if (process.env.NODE_ENV === `production`) {
css = <style id="gatsby-inlined-css" dangerouslySetInnerHTML={{ __html: stylesStr }} />
css = (
<style
id="gatsby-inlined-css"
dangerouslySetInnerHTML={{ __html: stylesStr }}
/>
)
}
return (
@ -38,7 +43,10 @@ module.exports = React.createClass({
{head.link.toComponent()}
</head>
<body>
<div id="react-mount" dangerouslySetInnerHTML={{ __html: this.props.body }} />
<div
id="react-mount"
dangerouslySetInnerHTML={{ __html: this.props.body }}
/>
{this.props.postBodyComponents}
</body>
</html>