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

Hook #290

Closed
kleinfreund opened this issue Oct 30, 2018 · 6 comments
Closed

Hook #290

kleinfreund opened this issue Oct 30, 2018 · 6 comments
Labels
enhancement needs-votes

Comments

@kleinfreund
Copy link
Contributor

@kleinfreund kleinfreund commented Oct 30, 2018

You know what would be cool? A static site generator that provides hooks for specific points in time during processing the files.

Especially hooking into before or after rendering a template would be helpful. The current API (like collections.getAll()) doesn’t really make it clear in which state my documents exist.

That said, which stages exist during one run of eleventy?

This would also be helpful for all sorts of build tool shenanigans.

Captain Hook grinning

@zachleat
Copy link
Member

@zachleat zachleat commented Nov 20, 2018

Ah, good questions! Just for my information, what sort of build tool shenanigans are you trying to facilitate here? Or maybe ideas will pop out after you know the lifecycle?

@zachleat zachleat added enhancement needs-votes labels Nov 20, 2018
@zachleat
Copy link
Member

@zachleat zachleat commented Nov 20, 2018

This repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open.

The enhancement backlog can be found here: https://github.com/11ty/eleventy/issues?utf8=%E2%9C%93&q=label%3Aneeds-votes+sort%3Areactions-%2B1-desc+

Don’t forget to upvote the top comment with 👍!

@kleinfreund
Copy link
Contributor Author

@kleinfreund kleinfreund commented Nov 20, 2018

Right now, I have no specific idea in mind. Always happens when I work on an Eleventy project.

What I can think of right now: A beforeRender and afterRender hook for all files Eleventy renders.

But let’s wait if there is any specific ideas. We shouldn’t implement something because it sounds nice.

@robdodson
Copy link

@robdodson robdodson commented Aug 15, 2019

I was also wondering if it's possible to diagram the lifecycle of an eleventy build (maybe this already exists?) so I know when _data files get processed and when collections get processed. I recently ran into a chicken and egg problem because I was trying to access my collections from one of my directory data files and it said the collection didn't exist yet.

@Ryuno-Ki
Copy link
Contributor

@Ryuno-Ki Ryuno-Ki commented Oct 9, 2019

@robdodson Something I might tackle at some point.
At the moment I am contributing JSDoc strings (which can be used for type checking down the road).

I guess, I will hit the lifecycle code at some point also.
Once I grokked it I'd like also to make a chart from it. What would you use for that? GraphViz/dot lang?

@robdodson
Copy link

@robdodson robdodson commented Oct 9, 2019

That'd be amazing if you were able to document it.

I'm not sure which library would be best. I often make such charts using things like Keynote because I like drawing in it, but if you're trying to have the graph generated by the code itself, then maybe another library would be more suitable.

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

No branches or pull requests

4 participants