You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a collections.postsByCategory which takes my collections.posts and returns a 2 dimensional array of those posts grouped by the fileSlug of the associated category.
This works great to build a category page that loops through all the posts in that category, but I'm struggling to figure out how to paginate this collection since it depends on passing in the fileSlug of the current loaded page (the category).
Specifically, I'm trying to use a before in order to return just the subset of the array I need, but this fails because I don't have access to the page variable in the scope of that before in order to get the current pages fileSlug.
I have a
collections.postsByCategory
which takes mycollections.posts
and returns a 2 dimensional array of those posts grouped by thefileSlug
of the associated category.This works great to build a category page that loops through all the posts in that category, but I'm struggling to figure out how to paginate this collection since it depends on passing in the fileSlug of the current loaded page (the category).
Specifically, I'm trying to use a
before
in order to return just the subset of the array I need, but this fails because I don't have access to thepage
variable in the scope of thatbefore
in order to get the current pagesfileSlug
.Am I going about this wrong?
The text was updated successfully, but these errors were encountered: