Visitar URL original
Pagination page not added to custom frontmatter collection · Issue #4326 · 11ty/buildawesome · GitHub
Skip to content

Pagination page not added to custom frontmatter collection #4326

Open

Description

@AqueM

Operating system

Microsoft Windows 10 Home

Eleventy

3.1.6

Describe the bug

  1. I created a filter to return all pages with the custom front matter mainMenu: true:
    eleventyConfig.addCollection("menuPages", function (collectionApi) {
        return collectionApi.getAll().filter((item) => item.data.mainMenu);
    });
  1. I created a page that iterates through a tag collection
---
mainMenu: true
linkName: Thoughts
pagination:
  data: collections.thoughts
  size: 10
  alias: pageItems
  reverse: true
---

where collections.thoughts references pages with tags: thoughts in front matter - an equivalent to blog posts.

  1. Despite having mainMenu: true after build, the first page of Thoughts collection does not appear in the menuPages collection. Other pages using pagination do appear in the menuPages collection, but they all iterate over collections originating from global data json files.

Expected behaviour:
when a page meets the criteria to be included in a collection, it is added to said collection, regardless of the data source it uses.

Reproduction Source Code URL

https://github.com/AqueM/webpage

Screenshots

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions