HiDeoo / starlight-blog

Starlight plugin to add a blog to your documentation
https://starlight-blog-docs.vercel.app
MIT License
106 stars 10 forks source link

URLs do not respect `trailingSlash` #48

Closed TheOtterlord closed 1 month ago

TheOtterlord commented 1 month ago

Describe the bug

URLs in the sidebar & prev/next buttons don't respect trailingSlash, leading to an extra redirect on some hosts.

To Reproduce

  1. Go to https://starlight-blog-docs.vercel.app/blog/
  2. Hover over any link in the sidebar, or the prev/next buttons

Expected behavior

For URLs to end with /

How often does this bug happen?

Every time

System Info

No response

Additional Context

No response

HiDeoo commented 1 month ago

Thanks for the report.

I'm a bit confused about the repro as the plugin docs are not configured with any trailingSlash option and from a quick look, sidebar links are generated using a getPathWithBase() function which should respect the option if specified 🤔

Adding trailingSlash: 'always' to the configuration seems to also change the generated links to include a trailing slash.

TheOtterlord commented 1 month ago

oh yeah, replicated locally too. looks like that was missing from my repro :sweat_smile:. for content this support thread is what I thought was affected. looks like it must be a different issue though.

HiDeoo commented 1 month ago

Thanks for linking the thread, I'll go take a look right now.