-
-
Notifications
You must be signed in to change notification settings - Fork 635
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
feat: pre / post parsing hooks #2925
base: v3
Are you sure you want to change the base?
Conversation
Thanks for the PR Can we also call a hook before parsing the file with raw markdown? There is also a feature request for Also let's rename the hooks and add
It is worth mentioning that the |
collection:parsedFile
hookcontent:file:beforeParse
, content:file:afterParse
commit: |
content:file:beforeParse
, content:file:afterParse
Thanks for the quick review! I've added beforeParse and renamed the after parse hook. It would be nice to have the content from afterParse typed but I don't think there's a way to do that unless we introduce collection based hooks but the complexity probably isn't worth pursuing at this stage. Let me know if you'd like anything else updated. |
π Linked issue
#2921
β Type of change
π Description
The runtime hooks from Content v2 were useful for modules to provide an integration with markdown files. For example, allowing users to provide custom frontmater keys or inferring data from the markdown body.
In Content v3 these runtime hooks are moved to the build time which is a great performance win, however, we no longer have access to the parsing hooks.
This PR introduces the
collection:parsedFile
hook to allow modules to start integrating with v3.π Checklist