Fix path to styles.css
This commit is contained in:
parent
532d70bcb9
commit
1d2329c1c9
1 changed files with 16 additions and 8 deletions
24
src/html.js
24
src/html.js
|
|
@ -1,24 +1,29 @@
|
||||||
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
render () {
|
render() {
|
||||||
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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue