Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to know all the pages before execution of a custom transform? #3238

Open
terpimost opened this issue Apr 1, 2024 · 2 comments

Comments

@terpimost
Copy link

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

@zachleat
Copy link
Member

zachleat commented Apr 9, 2024

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

@terpimost
Copy link
Author

Oh, thank you. That helps. Worth of putting it into the docs!

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

No branches or pull requests

2 participants