Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Header Dealing with different root path #69

Open
rturk opened this issue Dec 10, 2018 · 0 comments
Open

Header Dealing with different root path #69

rturk opened this issue Dec 10, 2018 · 0 comments

Comments

@rturk
Copy link

rturk commented Dec 10, 2018

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant