Solved: Bootsatrap navbar for gatsby project

Question:

I want to use bootstrap (v.5) navbar for a Gatsby project. In principle, it is possible to load components that only belong to the navbar. However, I can’t find any information about which components belong to the navbar.
So far these I have these imports but not yet working unfortunately: global.scss
Has anyone done this before? Do you know which components need to be imported to make it work?
Thanks for any help!

Best Answer:

I importing it to gatsby-browser.js. Shouldn’t it be here?


Yes, that’s one option. As well as importing it in the Layout component as the Standard Styling with Global CSS Files suggests.
The problem I guess is the path you’re using. From the gatsby-browser.js there’s no ../.. path hence the route and the asset is broken.
Try playing around with the path but I bet you can do directly something like:
Note that ./ should also work in the same way so try playing around with the relativity of the paths.

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com