Incorrect route matching with subfolder rootSee original GitHub issue
I deployed a site on Github Pages inside a subfolder and set Navigo’s root to that subfolder i.e.
I am getting a wrong match for Navigo links when the
href path is (correctly) set to
"bohemica-studio-website/en/projects/branding". The matching route should be
bohemica-studio-website/:language/projects/:name, but it ends up being
Interestingly, when I call the
router.match('bohemica-studio-website/en/projects/branding'), I get the correct route. Same, when I set the link without the root path i.e.
Maybe, there is some wrong deployment setting, but I feel that Navigo is being fed the right data, so it’s likely an internal issue. What do you think?
Thank you ✌️
P.S. Everything works fine on localhost when the root path is set to
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
I swapped the project a custom domain (and root folder), so I cannot test it. But it looks good and would consider it fixed👍
I see @stepanjakl. I would rather patch the generate method so it returns the path without app than forcing the full url path on the links. Conceptually the idea of Navigo is to be an app oriented. It shouldn’t know about the rest of the world. So I’ll probably provide an additional argument to the generate function which will strip the root.