-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
[RFC] Refactor Eleventy.js to extend eventEmitter #406
Comments
I’d like to see some built-in hooks to be available, in particular one for accessing documents (especially Markdown) before they’re and after they’ve been transformed to HTML. I haven’t wrapped my head around this completely, but I can imagine there being use cases where you want to access unprocessed Markdown or the resulting HTML in transforms. Maybe we should have pre-templating and post-templating transforms? |
@kleinfruend I'm building this feature. What kind of hooks would you like to see? |
I am exploring ways to rewrite relative image urls in my markdown files. My first attempt intersepts the image renderer in the markdown library. That somehow works, but I do not have access to the front-matter of the corresponding template, which makes the solution a lot less flexible as it is difficult to determine the output path of the page (somehow related to #379). Hooks could help here and would allow plugins to rewrite (relative) image urls in the markdown content before they are passed to the actual parser/library. |
Programmatic API related issues: #136 |
This repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open. View the enhancement backlog here. Don’t forget to upvote the top comment with 👍! |
@zachleat the user config already exposes an eventemitter. So really, it just needs to be implemented at lifecycle events |
Currently
Eleventy.js
is just a standard JavaScript class with methods.This makes it very hard to expose Eleventy's lifecycle to end-users.
Refactoring
Eleventy.js
to extendEventEmitter
will allow you to easily add lifecycle hooks to the Eleventy pipeline, and they could be exposed through.eleventy.js
.This would also afford the same functionality as Jekyll hooks.
The text was updated successfully, but these errors were encountered: