Open AlexKucera opened 7 years ago
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.
Edit: Note to self, I took the code from https://github.com/pedroborges/kirby-autogit/blob/f36e5bcdc2d8da1fc7c56f1a0f9a636e7673129a/lib/hooks.php
Cool. I have a very crude way involving Cron jobs working right now. But this sounds very promising.
Just pushed a commit (https://github.com/sebsel/kirby-micropub/commit/d3473c487342e67e922d5c5a362bbb6343d92b46) to fix this. Hope it works.
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. :)