Git Product home page Git Product logo

kirby-micropub's People

Contributors

sebsel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kirby-micropub's Issues

Formatting new posts

Hi Sebastian,

I am having a hard time wrapping my head around how to format new posts.

By default the plugin creates:

Text: Testing MicroPub posting from the micro.blog iOS app.

----

Client: https://micro.blog/

----

Updated: 2017-07-10 11:35:18

----

Date: 2017-07-10 11:35:18

what I want/need is this though:

Title: โ€”

----

Text: Testing MicroPub posting from the micro.blog iOS app.

----

Date: 10.07.2017

----

Time: 2017-07-10-11-35-18

----

Client: https://micro.blog/

----

Updated: 2017-07-10 11:35:18

So it's mainly the two different data formats and the extra (mandatory) title field, which I use for RSS purposes.

Can you point me in the right direction?

My Kirby config file looks like so:

/* micropub */

c::set('micropub.page-creator', function($uid, $template, $data) {
  // Rename fields (you can also rename Kirby's fields)
  if (isset($data['name'])) $data['title'] = "-";
  $data['date'] = $data['published'];

  // No double fields
  unset($data['name'], $data['published']);

  // Add new entry to the blog
  $newEntry = page('microblog')->children()->create($uid, 'microblog', $data);

  // Make it visible
  $newEntry->sort(date('Ymd', strtotime($data['date'])));

  // Return the new entry
  return $newEntry;
});

Time offset

Hi Sebastian,

I noticed that posts created with your plugin have the wrong the creation time.

Where does the plugin get the publish time from and can I set an offset somewhere?

Auto-Git trigger

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. :)

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.

Add Obj-class for relatedUrl-fields.

So you need to be able to do:

$inReplyTo = $page->inReplyTo()->toMf();
echo html::a($inReplyTo->url(), $inReplyTo->name());
echo html::a($inReplyTo->author->url(), $inReplyTo->author()->name());

Or something like that.

Make a snippet for the <head><link>'s

<link rel="authorization_endpoint" href="https://indieauth.com/auth">
<link rel="token_endpoint" href="https://tokens.indieauth.com/token">
<link rel="micropub" href="https://your.url/micropub">

And then with site()->url() and c::get()

Add support for q=syndicate-to

  • add to GET-route: return JSON-object with supported syndications
  • in endpoint::fillFields()-loop: check for mp--fields (or before that?)
  • check Brid.gy's syndication

Cannot get it to work

Hi,

I tried to install the Micropub plugin and run the https://micropub.rocks test suite on it. Discovery of the endpoint works and everything looks peachy. But then when running the actual tests nothing works. I always get an error 500:

HTTP/1.1 500 Internal Server Error
Date: Thu, 29 Jun 2017 12:46:31 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=xxx; expires=Fri, 29-Jun-18 12:46:31 GMT; path=/; domain=.alexanderkucera.com; HttpOnly
Vary: Accept-Encoding
Server: cloudflare-nginx
CF-RAY: 3768fd3612305134-SJC

{
    "error": "error",
    "error_description": "Non-static method IndieWeb\\IndieAuth::requireMe() should not be called statically, assuming $this from incompatible context"
}

Any idea what might be wrong?

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.