11ty / eleventy

A simpler site generator. Transforms a directory of templates (of varying types) into HTML.
https://www.11ty.dev/
MIT License
17.19k stars 494 forks source link

Incremental builds doesn't work with paginated collection #2992

Open monochromer opened 1 year ago

monochromer commented 1 year ago

I have collection, created with addCollection:

// eleventy.config.js

eleventyConfig.addCollection('articles', (collectionAPI) => {
  return collectionAPI.getFilteredByGlob('src/articles/*/*.md')
})

and data file for article template, that uses collection articles for pagination:

// src/pages/article/article.11tydata.js

module.exports = {
  layout: 'base',

  pagination: {
    data: 'collections.articles',
    size: 1,
    alias: 'article'
  },

  eleventyImport: {
    collections: ['articles']
  }
}

when i change md-file, template doesn't render in incremental mode:

[11ty] File changed: src/articles/one/index.md
[11ty] Wrote 0 files (skipped 32) in 0.03 seconds (v2.0.1)

Originally posted by @monochromer in https://github.com/11ty/eleventy/issues/975#issuecomment-1630849200

Example code: https://stackblitz.com/edit/stackblitz-starters-6114gn?file=_layouts%2Fbase.njk

monochromer commented 1 year ago

Is it possible to solve problem using getFilteredByGlob and data-file with pagination option?