Skip to content

Commit

Permalink
Merge pull request gatsbyjs#57 from HeinrichFilter/fix-root-path-in-l…
Browse files Browse the repository at this point in the history
…ayout

Fixes gatsbyjs#56 Make layout `pathPrefix` aware
  • Loading branch information
KyleAMathews authored Sep 20, 2017
2 parents 4448f72 + 3c90a89 commit b17dafa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/layouts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ class Template extends React.Component {
render() {
const { location, children } = this.props
let header
if (location.pathname === '/') {

let rootPath = `/`
if (typeof __PREFIX_PATHS__ !== `undefined` && __PREFIX_PATHS__) {
rootPath = __PATH_PREFIX__ + `/`
}

if (location.pathname === rootPath) {
header = (
<h1
style={{
Expand Down

0 comments on commit b17dafa

Please sign in to comment.