Closed amxmln closed 4 weeks ago
I think it makes sense to add the base
by default, but if we change it now, I feel like it would break many existing setups. Documenting it might be a good solution for now, and we can revisit this in Astro 5.
I don't quite understand, what API is this in reference to? What is page.url.next
? Can you link to docs on this API?
It's https://docs.astro.build/en/reference/api-reference/#pageurlprev. Currently paginate()
generates it, but it doesn't have knowledge of the current base IIUC.
This has been implemented in v5
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When having a
base
option configured, thepage
prop resulting from having a dynamic route with paginated content doesn’t take that base into account.This means that the URLs in
page.url.prev
andpage.url.next
are not prefixed with the configuredbase
. This (strangely) doesn't cause issues in development mode, but when running a preview after build, the links don’t work correctly.What's the expected result?
I believe
page.url.prev
andpage.url.next
should be correctly prefixed withbase
if it is defined in the configuration. If there are issues with that, the behaviour should at least be documented so developers can manually handle the case.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-kzsh3y?file=src%2Fpages%2Findex.astro
Participation