webmention.io icon indicating copy to clipboard operation
webmention.io copied to clipboard

Provide example javascript rendering code

Open cweiske opened this issue 6 years ago • 4 comments

It would be nice if there was some example code that fetches the webmentions for an URL and then takes the JSON data and actually renders the HTML and appends it to the page.

Use case would be not-so-technical users that want to use webmention.io on their static site.


Related to #94.

cweiske avatar Mar 22 '18 20:03 cweiske

Related:

  • https://gist.github.com/thedod/78b14341e39ca0d09131
  • Static rendering in Hugo: https://gitlab.com/kaushalmodi/hugo-theme-refined/blob/master/layouts/partials/webmention_rcv.html

cweiske avatar Mar 23 '18 12:03 cweiske

I implemented web mentions for my blog at https://mxstbr.com/thoughts, which is a React app built with Next.js. Here is the source for the components that fetch and render web mentions! https://github.com/mxstbr/mxstbr.com/tree/master/components/WebMentions

Hope that can be helpful for somebody 👍

mxstbr avatar Feb 09 '19 12:02 mxstbr

There's also https://github.com/PlaidWeb/webmention.js which a few of the community are using :smile:

jamietanna avatar Sep 22 '19 20:09 jamietanna

Hello everyone! I've written a new rendering component - it's a WebComponent, so it should work for most sites. GitHub | NPM | StackBlitz (modify the target to show the webmention of the corresponding page)

kwaa avatar Feb 14 '23 06:02 kwaa