Micropub-extensions

From IndieWeb
Jump to: navigation, search

This page is for documenting extensions to Micropub.

Discussion on GitHub

Server Commands

The Micropub spec reserves the mp- prefix in the form-encoded syntax as a mechanism for clients to give commands to servers. This section is for brainstorming additional uses of the mp- functionality.

Slug

Issues and discussion:
https://github.com/indieweb/micropub-extensions/projects/1

Many posting UIs provide an option for the user to choose a slug for the post that will be created.

wordpress-customize-slug.png

This proposal is for a new mp- command for the client to suggest a slug to the Micropub endpoint.

  • mp-slug=

The server may or may not decide to respect the requested slug, based on whether it would cause conflicts with other URLs on the site. For example, some URL structures are {year}/{slug}, so the server may decide to modify the slug to avoid conflicting with an existing one.

Implementations

Destination

Issues and discussion:
https://github.com/indieweb/micropub-extensions/projects/4

Specify a destination to create a new post on a web site other than the default. The value of mp-destination should be a uid from the array of destinations returned from q=config. See an example query response here.

Implementations

  • Clients
    • Monocle - Monocle will check if your Micropub server returns a list of destinations and will then provide an account chooser UI in the footer when viewing a timeline. Selecting an account will cause any of the response buttons to be sent with the corresponding mp-destination value.
  • Servers

New Properties

Post Status

Issues and discussion:
https://github.com/indieweb/micropub-extensions/projects/2
  • post-status=published (or no post-status set) - The post is published, or when the published date is in the future, the post is scheduled.
  • post-status=draft - The post is a draft, and should not be shown in lists. (Of course it's up to the implementation whether it wants to use a capability URL for draft posts or actually restrict it to logged-in users.)

Implementations

Visibility

Issues and discussion:
https://github.com/indieweb/micropub-extensions/projects/3
  • visibility=public (or no visibility set)
  • visibility=private

In addition to public/private visibility, Wordpress also supports password-protected posts. However, passwords are inherently insecure and also not very user friendly, and there are likely better solutions to the problem. Essentially the goal of password-protected posts on Wordpress is to provide "guest access" to posts, where the viewer does not need an account at the site. Flickr accomplishes this with something they call "guest passes".

As well as public or private there could also be use in a value to hide posts from a main feed. Grant Richmond uses visibility=unlisted for this with his photo posts that appear in a gallery collection - The photos have their own post with a unique viewable url, but appear in a gallery post in the main feed, not as multiple individual photos. "unlisted" is already in use by mastodon.

Implementations

Location Visibility

Proposal by David Shanske

  • location-visibility=public (or no visibility set)
  • location-visibility=private
  • location-visibility=protected

This is based on David Shanske's implementation in Simple Location, an Indieweb friendly location plugin, of the WordPress Geodata unofficial guidelines. It states a single property which can be set to public or private, with the absence of the property being considered to be public. Proposing the third property, which will allow for a less specific text only display, but no actual coordinates.

Implementations

Query

Micropub supports making a GET request to a Micropub endpoint with a q= parameter, in order to query aspects of the endpoint or for retrieving the original source content of posts. This section is for brainstorming additional uses of the query functionality. See also Micropub-brainstorming#Query_for_other_information

  • mp-config
  • venue - not yet implemented suggestion of a venue query for a client to retrieve venues as part of check-in functionality.
  • extended markup formats โ€“ right now it is relatively dependent on the server implementation how text content is treated (1:1, basic processing like linking URLs, Markdown, ...). A query could expose information about this (and maybe even be part of a way to choose for the user)
  • media endpoint history โ€“ query recent uploads to the media endpoint, e.g. the last X photos uploaded from a phone

Query for Supported Vocabulary

Issues and discussion:
https://github.com/indieweb/micropub-extensions/issues/1

This is an extension for returning what properties a Micropub server supports, so that a client like Quill or Indigenous could know to hide or rename the common choices in the UI. This is essentially using reverse [Post Type Discovery]. The following example would be returned as part of the ?q=config query

  "post-types": [
    {
      "type": "note",
      "name": "Note"
    },
    {
      "type": "article",
      "name": "Blog Post"
    },
    {
      "type": "photo",
      "name": "Photo"
    },
    {
      "type": "video",
      "name": "Video"
    },
    {
      "type": "reply",
      "name": "Reply"
    },
    {
      "type": "like",
      "name": "Like"
    },
    {
      "type": "repost",
      "name": "Repost"
    },
    {
      "type": "rsvp",
      "name": "RSVP"
    },
    {
      "type": "bookmark",
      "name": "Bookmark"
    }
  ]

Implementations

Query for Post List

Issues and discussion:
https://github.com/indieweb/micropub-extensions/issues/4

This is a possible extension to the q=source query on my micropub endpoint, if no url is provided it returns a list of posts. This makes the url part of the query really into more of a filter. This would be super handy for clients wanting to present a list of posts to edit/delete/undelete.

Another advantage of this extension is that your micropub server is just responsible for storing and listing posts as microformats, rendering posts can be another bit of software's responsibility

{
 "items": [
  {
    "type": [
      "h-entry"
    ],
    "properties": {
      "like-of": [
        "https:\/\/en.m.wikipedia.org\/wiki\/Poka-yoke"
      ],
      "uid": [
        "20170820131258_59998adae54d0"
      ],
      "published": [
        "2017-08-20T13:12:58+00:00"
      ]
    }
  },
  {
    "type": [
      "h-entry"
    ],
    "properties": {
      "photo": [
        "https:\/\/media.j4y.co\/2017\/cfd007ec-c819-47da-99a2-daec2e91a41e.jpg"
      ],
      "published": [
        "2017-08-19T18:30:40+00:00"
      ],
      "content": [
        ""
      ],
      "category": [
        ""
      ],
      "uid": [
        "20170819175715_59987bfb72c4f"
      ]
    }
  }
}

Implementations

Query for Category/Tag List

By sending q=category to the Micropub Endpoint, a JSON array of categories are returned.

Implementations

Brainstorming

category - suggestion to get all existing tags/categories in the client. Expectation is client would cache and do autocomplete

Questions

  • According to the current spec (2017-01), a GET ?q=config should also include the syndicate-to property. If the collection of supported properties grows, is this still a thing to hold on to? Venues and tags can make the response potentially large. Sebastiaan Andeweg
    • Agreed, I think the empty GET ?q=config should be very limited, and clients should reqest things with potentially large responses separately. Aaron Parecki 11:40, 11 April 2018 (PDT)

See Also