So, I wrote a Go package that makes plugins easier to write for Go applications. I think Hugo could get a huge benefit out of this, as everyone always has their pet feature that they want to see implemented.
I’d like to get people’s ideas on what kinds of things they’d like to add to Hugo that could be done via plugins. Loading plugins and all that stuff is easy, but figuring out where we need to add hooks to support extension via plugins is another matter.
Some obvious examples:
Custom content types (latex, etc)
Custom shortcodes (highlighting, etc)
Some less obvious and more tricky examples:
Adding values to the data passed to templates
Adding functions to the data passed to templates
I’m sure there’s 1000 other things I’m missing, so please help out by posting what you’d like to customize about Hugo.
Note: I started an issue on the Hugo repo, but I think discussion works better here.
Yeah, I was thinking exactly that - that I’d make a plugin that duplicates the functionality of something already in Hugo, so it would be the plugin infrastructure that would be tested, and not the logic of the code the plugin provides
This is a great feature. I haven’t had to patch or modify Hugo yet. But, as I use it on more advanced sites, I’d love to have plugin support as a more standard way to extend things.
Hugo 0.13 was rewritten to add internal support for handlers based on filetype. Currently all are written as part of the Hugo codebase, but it was designed very modularly with plugins in mind. It would be a great place to start with the plugins.
These plugin applications aren’t meant to be run manually. Instead, Packer core executes these plugin applications in a certain way and communicates with them. For example, the VMware builder is actually a standalone binary named packer-builder-vmware. The next time you run a Packer build, look at your process list and you should see a handful of packer- prefixed applications running.
p.s. You can probably close this older topic to keep all discussion over here.