Comment Jekyll blog from Fediverse

Add comments to static website build with Jekyll

Thanks to @carl and his toot about adding comments to Hugo static site. Read source for deeper understanding.

Comment Jekyll site

with small changes and tweaking the code to my preferences I’ve added the same implementation to this jekyll site.

You can add comments to any page on your site just adding some keys to your page front-matter section.

comments:
  show: true
  fediHost: linuxrocks.online
  fediusername: carl
  fediid: 105463655803971969

beware of front-matter formatting (two spaces indent)

  • show: true/false to control visibility

from your toot

https://linuxrocks.online/@carl/105463655803971969

this toot and its thread will load on your website on demand when pressing LOAD/CARGAR comments button (or any link you may want to use to trigger javascript code).

screenshot showing comments on my blog

HERE IS THE CODE

EDITED:

Get the code to include on your template or page

I had to upload it to this external service because jekyll here read it and interpreted as part of the code so some code was lacking.

CSS classes and formatting can be set to better suit to your website.

You have to add purify.min.js and purify.min.js.map to your site to clean and sanitize response from server.

Test it!!

here below you can add a comment or just reply to this toot


CC BY-SA

Comentarios

Utiliza a túa conta no fediverso // Comment using your fediverse account.

Responder/Reply