Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

How to add pagination? #70

Open
gazpachu opened this issue Dec 11, 2018 · 0 comments
Open

How to add pagination? #70

gazpachu opened this issue Dec 11, 2018 · 0 comments

Comments

@gazpachu
Copy link

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant