Fix path to styles.css
This commit is contained in:
parent
532d70bcb9
commit
1d2329c1c9
1 changed files with 16 additions and 8 deletions
22
src/html.js
22
src/html.js
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue