gatsby-starter-hero-blog icon indicating copy to clipboard operation
gatsby-starter-hero-blog copied to clipboard

How to add pagination?

Open gazpachu opened this issue 5 years ago • 0 comments

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!

gazpachu avatar Dec 11 '18 16:12 gazpachu