gatsby-plugin-collections

Create pages, with support for pagination and customizable permalinks, from a folder of Markdown files.

View the Project on GitHub mikefowler/gatsby-plugin-collections

Pagination

Quickstart Configuration Permalinks Pagination Layouts

Support for paginated collections is built in, and easy to configure. Update your collection object with a paginate key, specifying the layout to use for pagination and, optionally, the number of items to display per page:

collections: [
  {
    name: 'essays',
    path: `${dirname}/src/essays`,
    permalink: ':collection/:title',
    paginate: {
      perPage: 20,
      layout: 'Essays',
    },
  },
];

Pagination permalinks are of the format /:collection/:pageNumber, except for the first page, which is created at /:collection.