Let’s say I have a plugin that extends a very specific Kirby functionality. How would I test that? Sure, I can simply use the starterkit and put my plugin in
site/plugins and then do whatever I want. But how to I track my plugin in Git? I simply add the plugin folder, correct, but what if someone decides to contribute? He has to install Kirby as well and somehow set it up the same way - content, blueprints, etc. That’s the biggest problem. Besides, if you only track the plugin in Git, you can’t track Kirby-related stuff like blueprints and content, which is problematic.
My suggestion is to have another template that uses Kirby’s functionality to change the
content, etc. folders. This way, you can have the following directory structure:
/myplugin /kirby # Kirby installation that is ignored in Git /kirby /panel index.php /setup # Kirby configuration that is added to .gitattributes so it doesn't appear on Packagist /content /site /plugins /myplugin index.php # symlink to root index.php index.js # symlink index.css # symlink /src # plugin source .gitattributes .gitignore index.php # plugin PHP file index.js index.css package.json composer.json
With a setup like that, you can have Kirby completely out of Git while having a way to fiddle with it. Your configuration is in
setup and is tracked, but ignored in
.gitattributes so it doesn’t appear in the final tarball of Packagist. The only missing piece is how you can get Composer to install Kirby in the
kirby folder and avoid its
To contribute, you simply clone the repo, run
composer install which should somehow install Kirby in
kirby, and open the plugin in the browser by visiting
Right now, I’m fiddling with the upcoming Editor plugin by @bastianallgeier and something like this would’ve helped out a lot.