Comments (3)
Hey gryzzly,
maybe a cheap solution would be to use the 'push'-route, that is implemented in the plugin already.
You could create a bookmark for your friend that links to <Your-URL>/git-content/push
. That should push the content every time it is called.
I am not entirely sure but I think even for a simple button with a custom link you would have to create your own plugin and add a custom section in Vue that implements this button (you may want to take a look at this cookbook recipie: https://getkirby.com/docs/cookbook/extensions/first-panel-section)
In an old version of the plugin there was a button like the one you need, but I think it got removed when the panel was switched to Vue for v3 of kirby.
Maybe it will get implemented again - should not be too hard.
from kirby-git-content.
Very helpful, thanks for the kind advice!
I found this plugin called "Janitor" (https://github.com/bnomei/kirby3-janitor) that allows adding a button via fields in the blueprints, and I think adding a button to do an API call to /git-content/push should work!
I’ll update the issue once it’s working
from kirby-git-content.
Hey, so I‘m trying to call the git endpoint like this:
In config.php:
'bnomei.janitor.jobs' => [
'contentPush' => function (Kirby\Cms\Page $page = null, string $data = null) {
// $page => page object where the button as pressed
$kirby->call('/git-content/push?secret=foobar');
return [
'status' => 200,
'label' => $page->title() . ' ' . $data,
];
},
],
'thathoff' => [
'git-content' => [
'commit' => true,
'cronHooksEnabled' => true,
'cronHooksSecret' => 'foobar',
'displayErrors' => true
],
]
where contentPush
is a function that Janitor calls from a button in the panel. But pressing the button is always showing a dialogue saying: No route found for path: "git-content/push" and request method: "GET"
.
However, I can see that the route is indeed installed at http://localhost:8000/git-content/push
– if I visit it I receive the appropriate error message in JSON like this:
{"status":"forbidden","message":"Invalid secret passed"}
Do you see something obviously wrong with what I am doing?
Thanks!
from kirby-git-content.
Related Issues (20)
- Use of functions deprecated in Kirby v4 HOT 4
- Custom Path and some other options not settable HOT 2
- Call to a member function format() on bool HOT 1
- git identity not settable on shared hosting HOT 5
- Add buttons to revert/drop commits HOT 1
- SSH key issues with dokku HOT 3
- Is it normal to end up with all sorts of uncommitted `.lock` file deletes? HOT 3
- Add info about .lock files into README
- plugin possibly causes internal server errors with certain characters HOT 5
- switch to original git PHP lib (kbjr/Git) HOT 2
- Catch Error when working tree is clean HOT 1
- Array to string conversion error with Kirby 3.6 and PHP 8.0 HOT 8
- Return status for KirbyGitHelper::push() and ::pull() HOT 1
- Working fine locally but not committing when on public server HOT 5
- Only add files of changed page
- Working locally but not on server HOT 4
- Problems with Kirby 3.8.0-rc1 when installing without composer HOT 23
- error: unknown option `end-of-options' HOT 9
- 'KirbyGitHelper::$git is deprecated' error on saving HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kirby-git-content.