Skip to content
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

Add Pagination Out-of-the-box #2

Open
AllanPooley opened this issue May 15, 2019 · 0 comments
Open

Add Pagination Out-of-the-box #2

AllanPooley opened this issue May 15, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@AllanPooley
Copy link
Owner

AllanPooley commented May 15, 2019

gatsby-awesome-pagination

Example (Inside gatsby-node.js):


/* ---------------------------------------------
  = Creating Paginated Stories (Blog Feed) pages =
  ----------------------------------------------- */

  paginate({
    createPage, // The Gatsby `createPage` function
    items: postList, // An array of objects
    itemsPerPage: website.storiesPerPage, // How many items you want per page
    pathPrefix: ({ pageNumber }) => (pageNumber === 0 ? `/${website.blogSlug}/` : `/${website.blogSlug}/page`),
    component: blogFeedTemplate, // Just like `createPage()`
  });

@AllanPooley AllanPooley added the enhancement New feature or request label May 15, 2019
@AllanPooley AllanPooley self-assigned this May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant