sitewriter
sitewriter copied to clipboard
Bringing IndieWeb to the JAM (Micropub for static sites)
Sitewriter
This is a small Sinatra service that provides publishing endpoints for sites that cannot provide their own.
The first use case is Micropub posting of notes to my Middleman site via GitHub.
Essentially, a configured domain has some endpoints, which receive content and apply templates which are then sent to a store.
Authentication for configuration is provided via IndieAuth.com
I also use IndieAuth for the Micropub tokens. If you'd like to do the same, set the environment variable TOKEN_ENDPOINT to https://tokens.indieauth.com/token
Post type heuristics
- If
mp-typeis defined, use it - If
type== h-event orh== event: event - If
type== h-entry orh== entry:- If there is a
in-reply-tovalue: reply - quotation
- If there is a
repost-ofvalue: repost - If there is a
bookmark-ofvalue: bookmark - If there is a
checkinoru-checkinvalue: checkin - If there is a
like-ofvalue: like - If there is a
videovalue: video - If there is a
photovalue: photo - If there is a
audiovalue: audio - If there is a
namevalue: article - Otherwise: note
- If there is a
N.B. entries are flat. The value of a property may be an entry itself, but the "deeper" values will not be flattened for post type discovery.
Credits
This was inspired by and initiated as a fork of Barry Frost's Transformative.