-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
feat: add first and last to the Page interface #11176
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a major
changeset. A reviewer will merge this at the next release if approved.
Looks like we forgot to followup on this PR. I queued this up for the next minor in 4.12.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving for docs!
* 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 <[email protected]> --------- Co-authored-by: Bjorn Lu <[email protected]> Co-authored-by: Matthew Phillips <[email protected]> Co-authored-by: Sarah Rainsberger <[email protected]>
* 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.last
to 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!