Client side reply contexts with JavaScript (original) (raw)

Reply contexts are anIndieWeb feature that displays a short summary view of a post that you’re replying to,liking,reposting, orRSVPing to.

Most reply context implementations run on the server, when publishing or updating a post. They fetch the original post, extract the useful parts, store them locally, and include them when rendering the reply post.

This is fine, but there’s another option. You could write a JavaScript library that injects reply contexts into a post after it’s rendered on the client, in the browser. The interesting part is that this library could work on any CMS; all you need to do is serve it!

Here are the steps it would take after a document is loaded:

Thoughts?

I’ve long avoided implementing reply contextshere on snarfed.org. I very much enjoy using WordPress, but I don’t particularly enjoy hacking on it. Having said that, I’ve had this idea in the back of my mind for a while now, and mentioned it to enough people, so I decided it was time to write it up.

Also on IndieNews.