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