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

Preprocessing and Postprocessing Hooks? #325

Open
swamidass opened this issue Oct 30, 2022 · 1 comment
Open

Preprocessing and Postprocessing Hooks? #325

swamidass opened this issue Oct 30, 2022 · 1 comment

Comments

@swamidass
Copy link

I have a metalsmith site I'd like to move over or integrate with contentlayer.

Unlike CL, Metalsmith has straightforward ways of looking at the whole collection while processing individual documents. This allows, for example, ensuring that all internal website links are to documents that already exist. MS also has a large library of useful plugins.

Is there a way to hook metalsmith into content layer reloading, so it is run first before content layer? Or more directly use metalsmith to process files within content layer itself. As a work around, I suppose, I could use metalsmith to generate a directory of json files that is then used as input to content layer. But this requires basically managing two content systems.

Alternatively, is there a way to hook into the contentlayer process with content processors that can transform individual documents while having access to all collections?

@schickling
Copy link
Collaborator

Thanks for opening this issue @swamidass. Those are some really interesting ideas and use case.

Unfortunately I don't have the capacity right now to investigate/research these use cases further myself but I'd encourage you or other community members to dig into this further and create a proposal how this could work and/or what would be necessary on Contentlayer's side to enable this use case.

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