-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
href inside +layout.svelte always relative to current url, not the file route #10708
Comments
You need to construct the appropriate URLs yourself. There's no concept in HTML of a base URL just for a part of a page, and we don't want to take URL resolution out of the hands of the browser, or rewrite |
I believe this is related to this, but I can't find the solution. Is there no way to get the path of the file (not the current route, as in $page.route or $page.url)? So that we can prepend it in the href. I think it'll be very useful for deep nested routes, especially if it has lots of slug. <li class="crumb"><a href="/dashboard/projects/{$company.id}/{year}/{month}/{$project.id}/items">{$project.name}</a></li> |
Describe the bug
My routes structure is like this
Inside
+layout.svelte
I have a tabbed layout using anchorsClicking the tab works for the first time, it goes to
/dashboard/programs/inventory/
, but when I click the same tab again it will go to/dashboard/programs/inventory/inventory/
which is 404.trailingSlashes
is set to “always”, other values won't work.How to fix this without using absolute path?
Reproduction
Repo
Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: