gatsby-starter-hero-blog
gatsby-starter-hero-blog copied to clipboard
Header Dealing with different root path
Hi All,
I'm using this great template inside a existing website, so it's not located in the root folder /
it's located in a /university
folder.
I'm struggling with the header
component, the code below checks for root
, in this case /
and includes or not additional classes to the Header.
https://github.com/greglobinski/gatsby-starter-hero-blog/blob/master/src/components/Header/Header.js#L27
I was able to partially fix this including the following code:
const isHomepage = (this.props.path === "/" || this.props.path === "/universidade/") ? "homepage" : "";
It works, but it won't scale, for example, breaks if Google analytics sends utm
tag.. etc.. IMO this is not the best solution.
Any ideias for how to improve this?