-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Inaccurate Page interface for Pagination in Routing guide #8929
Comments
The issue on |
Great catch, @ArmandPhilippot and I totally agree that there is duplication to show the full API reference here if it's in on the reference page. However, I did notice that while we list out all the properties in the API reference, we don't show it all in one nice example like we do here. Deleting it from the routing page and linking to the full API reference instead makes sense. If we did that, what do you think about reproducing this block on the API reference page instead, just before listing out each property? Is that too much? Is it helpful to be able to see everything at once, or is it unnecessary? We also currently do not link back to the API reference page at all, and I think we should! So my thought is yes, delete the "Full API reference" section and instead include a (I also noticed that on the API reference page, |
I think it's a matter of taste. From a personal point of view, I would say that it is a duplicate but some might find this useful. Since the goal of a documentation is to be useful to as many people as possible, this addition makes sense to me. Those who are not interested can easily scroll down the page. However, adding this block could harm the coherence of the page. Other types do not show the full interface before going into detail about each property. For example:
So if we add the full interface, maybe we should do it for other types.
Of course, I can take care of it!
I will look the types if find some other helpful information to add! |
OK, so maybe this is reason enough not to do it! 😅 Here's my current thinking: Routing page:
API reference page: (can be handled separately, doesn't have to be the same PR)
How does that sound? |
@sarah11918 This looks good to me. And yes, I will make two different PRs because it's probably better for translators if the page is only updated once 😄 and I'd like to check for missing |
I'm sure the missing |
📚 Subject area/topic
Routing/Pagination
📋 Page(s) affected (or suggested, for new content)
https://docs.astro.build/en/guides/routing/
https://docs.astro.build/en/reference/api-reference/#paginate
📋 Description of content that is out-of-date or incorrect
The Routing guide displays a complete API reference for the
page
prop related to Pagination. This reference is no longer accurate since withastro/astro#11176. The documentation has been updated in API reference (see #8751) but not inguides/routing.mdx
.There is another mistake I think. The default for
page.size
seems to be10
and not25
(see paginate.ts#L19 and paginate.ts#L80). It seems this error comes fromastro/@types
comment. I created a Stackblitz reproduction for this. I'll make an update there as well.I could update the Routing guide but I wonder if this section is relevant. Since we already have the interface in API Reference, it seems duplicated (and prone to errors when new features are added). I think a link to the API Reference could make more sense:
And we could add the default for
pageSize
/page.size
to the API Reference page.What do you think?
🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)
For the
page.size
issue only: https://stackblitz.com/edit/astro-paginate-pagesize?file=src%2Fpages%2Fpokemon%2F[page].astro&on=stackblitzThe text was updated successfully, but these errors were encountered: