GoBlog has a (still experimental) plugin system, that allows adding new functionality to GoBlog without adding anything to the GoBlog source and recompiling GoBlog. Plugins work using the [Yaegi](https://github.com/traefik/yaegi) package by Traefik, are written in Go and are interpreted at run time.
You need to specify the path to the plugin (remember to mount the path to your GoBlog container when using Docker) and the Go packakge and you can additionally provide configuration for the plugin.
There are different plugin types for different functionalities a plugin wants to support. A plugin can implement multiple plugin types. You can find more information about the plugin types [in the Go documentation](https://pkg.go.dev/go.goblog.app/app/pkgs/plugintypes).
// Do something, but at least write something to modified, otherwise, the page will stay blank
}
```
If you want to access the configuration that is provided for your plugin, you need to implement the `SetConfig` plugin type. To access some more functions of GoBlog, implement the `SetApp` plugin type that allows you, for example, to access the database or get posts and their parameters.
### Packages provided
Several go modules are already provided by GoBlog, so you don't have to vendor them.
GoBlog modules:
-`go.goblog.app/app/pkgs/plugintypes` (Needed for every plugin)
-`go.goblog.app/app/pkgs/htmlbuilder` (Can be used to generate HTML)
-`go.goblog.app/app/pkgs/bufferpool` (Can be used to manage `bytes.Buffer`s more efficiently)
Third-party modules
-`github.com/PuerkitoBio/goquery` (Can be used to *manipulate* HTML in a jquery-like way)
### AI generated summary (Path `embedded:aitldr`, Import `aitldr`)
A plugin that uses the ChatGPT API to generated a short one-sentence summary for the blog post (after creating or updating it). To prevent it from generating a summary for a post, add the following post parameter: