Giter Club home page Giter Club logo

Comments (3)

moddyn6 avatar moddyn6 commented on May 31, 2024 1

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.

gryzzly avatar gryzzly commented on May 31, 2024

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.

gryzzly avatar gryzzly commented on May 31, 2024

@moddyn6

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.