Is there any official support for pre-proccessing of content?
What I want to be able to do is run some scripts over the pages before the main build is run. There are a few things I want to be able to do:
- Generate pages from data
- Duplicate pages with the layout tweaked
I would like these things to be run automatically when I call hugo
so that I don’t have to run multiple scripts to build my site.
Example scenario…
I have a newsletter type
in Hugo that I want to render as both a page on my site and an email template. When processing I want to:
- Duplicate the page with a different layout (one that renders the full page as the email)
- Call my mail tool API to
sync
any changes to the campaign based on the front matter. (schedule, subject, etc…)
Of course, I can run a script before the build, but it would be much more elegant if we had a folder of scripts that we can have Hugo execute in order before the build is executed.
I’m happy to learn some Go to achieve this.