Routify Absolute Paths not working with nested routes

885 views Asked by At

Moved a sapper appliacation to svelte/routify. Overall, I like the structure better, but I am having issues with absolute paths.

I have a Nav bar which has the following links

  1. Home
  2. About
  3. Items

and I have another route that is not in the Nav, that is a nested dynamic route for Items [item].svelte.

Naviagtion works fine, but whenever I hit the nested dyanmic route www.example.com/items/item, I get the page, but cannot navigate back to the other "parent"/ non nested pages.

So, when clicking a link once, and I reach that nested route, the url path ( in the browser search bar ) changes to the proper path ( i.e. going from www.example.com/items/item to www.example.com/about, but the about page wont load. of course, from this stage, reloading the page makes the page appear.

My nav links look like ... <a href="/items" ... > and <a href="/about" ... >, and so on.

Thank you in advance for the help.

1

There are 1 answers

0
Stephane Rainville On

try using the url helper method instead of direct hrefs.

<a class="nav-link" href={$url('./irrigation')}>Irrigation