Go, blog with GoBlog!

A blog about GoBlog

A rewritten plugin system

Published on in Updates
Short link: https://goblog.app/s/b
⚠️ This entry is already over one year old. It may no longer be up to date. Opinions may have changed.

I hate breaking things (and backwards compatibility), but sometimes it’s the only way to get to new levels. And that’s because I had to break (and rewrite) the plugin system. To add more power and enable a bright future.

The old plugin system (which I said was “experimental”) had some limitations: Each plugin could only implement a single plugin type, and sometimes had to implement unused and unnecessary functions. It wasn’t very flexible.

The new plugin system (which is still experimental! But probably won’t change much anymore…) is much more flexible. Each plugin can implement an unlimited number of “plugin types” (like a UI, middleware, etc.).

The UI plugin type has also become much more powerful. Now it is called whenever an HTML page is rendered, even error pages. The plugin can read all the (unminified) HTML, modify it using goquery (which is bundled and doesn’t need to be “vendor"ed) or any other method, and write it back to GoBlog. Two of the embedded plugins (plugins you don’t need to copy to your GoBlog installation, they are included in the executable) use this functionality: A plugin to add syndication links and a plugin to display webring links in the footer. It is also possible to use this to show additional HTML elements for custom post parameters, for example.

Now there is a basis for many more plugin hooks to come and enhance the power of plugins.

Sorry for breaking your existing plugins! Check out the documentation, it now includes an implementation guide!

GoBlog
Interactions & Comments