eleventy
eleventy copied to clipboard
Is it possible to know all the pages before execution of a custom transform?
Operating system
Linux
Eleventy
2.0.1
Describe the bug
I would like to process all the pages in a deterministic way, but right now pages to custom transform are passed in non deterministic way (order of pages is different on different computers). Is it possible to somehow have an index of pages before my transform is executed, so I at least can have a sorted list of all pages inside my transform?
Reproduction steps
No response
Expected behavior
No response
Reproduction URL
No response
Screenshots
No response
Just so I’m clear, what do you mean by process? You want to influence the order in which pages are processed by Eleventy?
If not and the processing order doesn’t matter here—does this event work?
eleventyConfig.on("eleventy.contentMap", ({ inputPathToUrl }) => {});
Read more about Eleventy events: https://www.11ty.dev/docs/events/ (though this one is missing from the docs)
There are a couple other ways to get this information, but we can start here I think
Oh, thank you. That helps. Worth of putting it into the docs!
Shipping the eleventy.contentMap event to the docs: https://www.11ty.dev/docs/events/