Merge pull request #57 from HeinrichFilter/fix-root-path-in-layout

Fixes #56 Make layout `pathPrefix` aware
This commit is contained in:
Kyle Mathews 2017-09-20 06:28:09 -07:00 committed by GitHub
commit b17dafaccc

View file

@ -8,7 +8,13 @@ class Template extends React.Component {
render() { render() {
const { location, children } = this.props const { location, children } = this.props
let header let header
if (location.pathname === '/') {
let rootPath = `/`
if (typeof __PREFIX_PATHS__ !== `undefined` && __PREFIX_PATHS__) {
rootPath = __PATH_PREFIX__ + `/`
}
if (location.pathname === rootPath) {
header = ( header = (
<h1 <h1
style={{ style={{