hooks api
Closed this issue · 4 comments
gjohnson commented
Need hooks exposed from the API.
- before the destination directory is created
- after the destination directory is created
What else?
ianstormtaylor commented
I think I was thinking a while back about stages:
- after prompting for input, but before rendering the templates
- after rendering the templates, but before writing to disk
- after writing to disk
Not sure if the "after writing" is even useful though since it could be argued to be out of scope, and really what could we want to do there that wouldn't be done in the Metalsmith-like part. But maybe for other things like "uploading something to S3" since this has more scope than just Metalsmith-like operations?
ianstormtaylor commented
For more clarity if those are the ones we get the goals:
- Post-prompt: goal is to edit the metadata before using it to render things?
- Post-render: goal is to add extra files based on the metadata?
- Post-write: goal is to do more project-setupy-build-tasks?
ianstormtaylor commented
Looking more, I think you're right we only need before/after
since the other two don't have any real use cases I can think of that differ
ianstormtaylor commented
added back as .before()
and .after()
now!