feat: add first and last to the Page interface#11176
feat: add first and last to the Page interface#11176matthewp merged 3 commits intowithastro:mainfrom
Conversation
🦋 Changeset detectedLatest commit: b5b8554 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Looks like we forgot to followup on this PR. I queued this up for the next minor in 4.12.0 |
sarah11918
left a comment
There was a problem hiding this comment.
Just placeholding for docs here! When I get a docs PR, then I'll be able to review!
.changeset/twenty-maps-glow.md
Outdated
| 'astro': minor | ||
| --- | ||
|
|
||
| feat: Add urls to the first and the last page in the Page interface |
There was a problem hiding this comment.
This will need updating, will wait to see what the docs PR is to know what to suggest.
|
Will need docs for this. @tsawada will you be able to write them? |
|
Added a docs PR with my suggestion here, since this appears to be similar to other existing items. Please read carefully for accuracy, as I inferred e.g. when the value is undefined based on the previous and next entries! |
sarah11918
left a comment
There was a problem hiding this comment.
Thank you for this very handy addition to the page prop, @tsawada ! I think people will make very good use of this! 🙌
I've gone ahead and drafted a Docs PR to accompany this, but I will need you to review and make sure it's accurate, as well as my suggestion here for the message that will show up in the CHANGELOG.
So, docs aren't ready to go but I've tried to move them along with a suggestion. Once you've approved or corrected them, then Docs is happy!
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* feat: add first and last to the Page interface * Update .changeset/twenty-maps-glow.md * Update .changeset/twenty-maps-glow.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> --------- Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> Co-authored-by: Matthew Phillips <matthew@matthewphillips.info> Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Add default for `page.size` and `pageSize` (see withastro/astro#11561) * Add missing Since for `page.url.first` and `page.url.last` (see withastro/astro#11176)
* Add default for `page.size` and `pageSize` (see withastro/astro#11561) * Add missing Since for `page.url.first` and `page.url.last` (see withastro/astro#11176)
Changes
Add
page.url.first,page.url.lastto the Page interface.Closes withastro/roadmap#862
Testing
I couldn't find relevant tests for
page.url. Let me know if there is one already.Docs
This needs to be updated
https://github.com/withastro/docs/blob/main/src/content/docs/en/guides/routing.mdx#complete-api-reference
/cc @withastro/maintainers-docs for feedback!