gatsby-starter-hero-blog
gatsby-starter-hero-blog copied to clipboard
How to add pagination?
I'm struggling to add the pagination :( I've tried both plugins (gatsby-pagination and gatsby-paginate) but I see no difference. I still get the full list of posts. With gatsby-pagination I'm adding the following to gatsby-node.js:
const { createPaginationPages } = require("gatsby-pagination");
const indexPage = path.resolve("./src/pages/index.js"); const items = result.data.allMarkdownRemark.edges;
createPaginationPages({ createPage: createPage, edges: items, component: indexPage, limit: 5 });
// Then the following blocks... // Create category pages // Create posts // and pages. Any idea of what I'm doing wrong? I'm still learning about Gatsby. Cheers in advance!