Mastodon Comments for Static Sites
Topics: Jekyll, Static site generator
Replace Disqus with Mastodon-powered comments on a static blog. A web component fetches replies to a toot and renders them as comments. No tracking, no ads, no third-party accounts.
Subtopics
Bookmarks
- https://jonhnnyweslley.net/blog/mastodon-comments/
How it works
- Write and publish a blog post
- Post a toot announcing it
- Add the toot ID to the post’s frontmatter
- The web component fetches replies from the Mastodon API and renders them as comments
No JavaScript framework, no cookie banner.
Setup (Hugo example)
- Add the
mastodon-commentsweb component (Daniel Pecos Martinez) to assets - Configure Mastodon account in
config.yml - Replace comments partial to render when
tootIdpresent in frontmatter - On publish: toot → copy ID → add to frontmatter → redeploy