|
1 | 1 | # Kirby Janitor |
2 | 2 |
|
3 | | - |
4 | | - |
5 | | -[](https://flat.badgen.net/codeclimate/coverage/bnomei/kirby3-janitor) |
6 | | -[](https://codeclimate.com/github/bnomei/kirby3-janitor) |
7 | | -[](https://discordapp.com/users/bnomei) |
| 3 | +[](https://getkirby.com) |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +[](https://codeclimate.com/github/bnomei/kirby3-janitor) |
| 8 | +[](https://codeclimate.com/github/bnomei/kirby3-janitor/issues) |
| 9 | +[](https://discordapp.com/users/bnomei) |
| 10 | +[](https://www.buymeacoffee.com/bnomei) |
8 | 11 |
|
9 | | -Kirby Plugin for running commands. |
| 12 | + |
| 13 | +Janitor is a Kirby CMS Plugin for running commands. |
10 | 14 |
|
11 | 15 | - It is a Panel Button! |
12 | 16 | - It has commands built-in for cleaning the cache, sessions, create zip-backup, pre-generate thumbs, open URLs, refresh the current Panel page and more. |
@@ -78,6 +82,21 @@ return [ |
78 | 82 |
|
79 | 83 | ``` |
80 | 84 |
|
| 85 | +### View Buttons |
| 86 | + |
| 87 | +You can also use Janitor to create up to 10 custom [view buttons](https://getkirby.com/releases/5/view-buttons#custom-vue-component). |
| 88 | + |
| 89 | +**site/blueprints/page/default.yml** |
| 90 | +```yml |
| 91 | +buttons: |
| 92 | + janitor: # or janitor_1, janitor_2, ... janitor_9 |
| 93 | + command: whistle |
| 94 | + label: Whistle |
| 95 | + icon: audio |
| 96 | + preview: true |
| 97 | + settings: true |
| 98 | +``` |
| 99 | + |
81 | 100 | ### Callback |
82 | 101 |
|
83 | 102 | Instead of using a command you can also create a callback in a custom plugin options or any config file. |
@@ -169,6 +188,7 @@ In either the command or the callback you will be setting/returning data to the |
169 | 188 | - `icon`, see `icon`-field option |
170 | 189 | - `label`, see `label`-field option |
171 | 190 | - `message`, see `message`-field option |
| 191 | +- `notification`, array of method and message, like `['success', 'Deployed!']` |
172 | 192 | - `open`, URL to open, use with `intab`-field option to open in a new tab |
173 | 193 | - `reload`, if `true` will reload panel view once api call is received |
174 | 194 | - `success`, see `success`-field option |
@@ -401,6 +421,10 @@ return [ |
401 | 421 |
|
402 | 422 | You can also overwrite the maintenance snippet if you create your own and store it as `site/snippets/maintenance.php`. |
403 | 423 |
|
| 424 | +## Tinker(well), REPL and Debugging |
| 425 | + |
| 426 | +You can use the `kirby janitor:tinker` command to start a REPL session in the terminal. This is a great way to test code snippets, debug and explore your Kirby installation. Another alternative would be using the [Tinkerwell App](https://tinkerwell.app/) which has built-in support for Kirby as long as it can find the `./kirby/bootstrap.php` file via the matching [driver](https://github.com/beyondcode/tinkerwell/blob/58254e11a6aad428eefd63b1ae624b0568414227/src/Drivers/KirbyTinkerwellDriver.php#L14). |
| 427 | + |
404 | 428 | ## Dependencies |
405 | 429 |
|
406 | 430 | - [Kirby CLI](https://github.com/getkirby/cli) |
|
0 commit comments