docs: migrate website to Gatsby v2 (#1623)
* website: initial conversion to gatsby v2 * fix unexpected history use warning * use commonjs only to fix gatsby error * fix gatsby import error with sidecar * remove unused postcss-colour-functions * remove unused prop * lowercase layout filename import to match actual file * chore(lint): format code
This commit is contained in:
@ -1,22 +1,10 @@
|
||||
import React from 'react';
|
||||
import Gitter from 'react-sidecar';
|
||||
// gatsby throws some error when importing just react-sidecar.
|
||||
// Maybe because jsx file ext?
|
||||
import Gitter from 'react-sidecar/dist-modules/index.js';
|
||||
|
||||
let stylesStr;
|
||||
if (process.env.NODE_ENV === `production`) {
|
||||
try {
|
||||
stylesStr = require('!raw-loader!../public/styles.css');
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = class HTML extends React.Component {
|
||||
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 {...this.props.htmlAttributes}>
|
||||
<head>
|
||||
@ -30,7 +18,6 @@ module.exports = class HTML extends React.Component {
|
||||
<meta name="apple-mobile-web-app-title" content="NetlifyCMS" />
|
||||
<meta name="application-name" content="NetlifyCMS" />
|
||||
{this.props.headComponents}
|
||||
{css}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://unpkg.com/docsearch.js@2.5.2/dist/cdn/docsearch.min.css"
|
||||
@ -47,4 +34,6 @@ module.exports = class HTML extends React.Component {
|
||||
</html>
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default HTML;
|
||||
|
Reference in New Issue
Block a user