profile profile

Blog post content types

Finally you can get my blog post content in a number of different formats. You'll notice alternative URLs (noted currently as 'Permalink') in the metadata section of a normal view of a post. Hit this up with no Accept header, and you'll get neat markdown (which is what I authored it in; the 'source', as it were).

Browsers automatically send Accept: text/html, in which case they are redirected to the rendered HTML version of the post you're probably reading now. But here are some alternatives you can try:

 curl https://rhiaro.co.uk/llog/micropub-test

-> plain markdown.

 curl -H "Accept: application/json" https://rhiaro.co.uk/llog/micropub-test

because there's obviously not enough JSON in the world. Note this isn't correct JSON-LD yet. I'll sort that out another time.

 curl -H "Accept: text/turtle" https://rhiaro.co.uk/llog/micropub-test

Ohemgee! RDF! It's what you've all been waiting for, I know.

For those of you who like angular brackets, you could try:

 curl -H "Accept: rdf/xml" https://rhiaro.co.uk/llog/micropub-test

Relevance to micropub

Briefly discussed with Tantek, Aaron and Bret at IWC Cambridge and on IRC about how a micropub client could fetch post content for editing. Many people aren't editing raw HTML as it's presented on the page, but maybe markdown or some other syntax, so a client needs to be able to discover this (the 'source') to present it to be edited. Now if someone makes their client check a post for a rel="source" or shoots off a request with Accept: text/plain (less likely, since static sites can't do conneg) then they'll get my markdown directly (uh, when I actually put rel="source" in my HTML, which I haven't yet).

As a related aside, I also return source="markdown" if a micropub client asks my endpoint q=source.

🏷 http://vocab.amy.so/blog#Doing http://vocab.amy.so/blog#Doing content negotiation hacking htaccess indieweb linked data micropub modrewrite php rdf slogd turtle uris