The plugins are based on composer and are automatically included by Stati at runtime.
Put your code in the
src/ folder. This folder should at a minimum contain a namespaced class that extends the
The namespaces for all classes in your plugin should start with
yourplugin is the name of the folder your plugin resides in. So basically if your plugin is called
categories it should have at least one file in the src folder called
Categories.php containing a class definition as follows:
The Plugin class itself is a Symfony Event Subscriber, so your class should implement the
getSubscribedEvents so that stati knows which events your plugin listens to. Here is an example from the related posts plugin:
Here is a list of all the events that your plugin can subscribe to, and their description
The phars for all plugins and Stati itself are built using box
It is an easy way to build phar archives.
You can take a look at the paginate plugin for an example of how plugins are structured.
More examples :