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
URL helper keeps /index #192
Comments
Hi @george-oakling. I completely missed this issue. Sorry! Is this still an issue? |
Hi, It's still an issue for me. console.log($url('./' + account.id)); All of these will return the same result: "/accounts/index/asdbasd163" my structure is: having an index.svelte at both the accounts and [id] directory version installed |
@esgabo, could you try |
console.log($url('../' + account.id)); Result: /accounts/asdbasd165 I think it's still an issue, since I would expect the "index" when it's true. |
The Consider
You don't want the home link to always be active, so you use I agree with your view on path resolution and for Routify 2 we'll align with filesystem conventions rather than URL conventions. For v1 we have to stick with the current convention to not introduce breaking changes. |
I see. Then it seems to work as expected for v1 and I just misunderstood how current path works on routify. (perhaps a clarification on the doc?) Looking forward that v2. Keep the good work. Thanks for the lesson :) |
Thanks for the feedback. I think I can finally put this issue to rest. |
Since this is planned behavior for v2, could we maybe implement this behind an option in v1 so we can start writing v2 compatible code right away? |
Brillliant idea @rixo. |
This was added to 2.0. Hoping to release it in the very near future. |
bug description
url helper doesn't care about the third optional param to keep/remove index from relative URL. Example: I have this structure:
I am having a link
<a href={$url('./', {param: xxx}, false)}
on pages/subpages/index.svelte and it keeps the index in URL generated /pages/subpage/index?param=xxx regardless the third parameter is set to false or true.The question is: How to remove it? 😄
version
Routify: 1.7 (and 1.8 beta)
Svelte: 3.22.3 (and 3.23.0)
The text was updated successfully, but these errors were encountered: