You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2022. It is now read-only.
I see that you at least took a look at the Auto-Git plugin. Do you know of a way to make your plugin trigger the Auto-Git routine?
Pedro the developer mentions something that looks to be a simple line of code to make it work. I have just no idea where to put it. :)
Auto Git uses Kirby hooks to detect changes:
kirby()->set('hook', 'panel.page.create', function ($page) {
autogit()->save('page.create', $page);
});
The save method runs git add -all content/ followed by a git commit -m 'Message goes here'.
So yes, it would get committed on the next change done via the panel.
Other plugins could call the save method as well.
Maybe I can make that even easier and more customisable.
The text was updated successfully, but these errors were encountered:
Well, I have seen Auto-Git, but I have not used it myself yet.
I already trigger a hook in /lib/endpoint.php#L302, but it seems that that is insufficient. It's a weird choice of params I chose, so I need to change that.
The solution should be, in your config.php (note the 'micropub'):
kirby()->hook('micropub.page.create', function ($page) {
autogit()->save('page.create', $page->uri());
});
kirby()->hook('micropub.page.update', function ($page) {
autogit()->save('page.update', $page->uri());
});
Please note that this does not work yet. I need to make some changes to the Micropub plugin.
Hi Sebastian,
me again. :)
I see that you at least took a look at the Auto-Git plugin. Do you know of a way to make your plugin trigger the Auto-Git routine?
Pedro the developer mentions something that looks to be a simple line of code to make it work. I have just no idea where to put it. :)
The text was updated successfully, but these errors were encountered: