No description
| demo | ||
| src | ||
| .gitignore | ||
| README.md | ||
fediverse-comments
This project allows bloggers to integrate comments from the Fediverse to their articles, as an alternative to self-hosted solutions that require visitors to register, and to proprietary solutions that are full of trackers.
Features
- ✨ Easy iframe-based setup.
- 1️⃣ One-click commenting : no URL copy-pasting required.
- 🏠 Redirects to (and remembers) the user's home instance.
- 🔄 Refreshes comments after commenting.
- ✅ Multiplatform support : Mastodon, Lemmy, more to come !
- 🎨 Theming supported.
- 🤫 Tracker-free, does not report back on your commenting activity.
Usage
Add the following elements to your blog page :
- a
scriptimport to/src/fediverse-comments.js; - and an
iframeembed to/src/main.html:- with a
urlsquery parameter as a comma-delimited list of post URLs to fetch the comments from ; - with an optional
customThemequery parameter as a URL to a CSS theme file ; - with an optional
themequery parameter, to set tocustomto apply the one provided with thecustomThemeparameter ; - with the
onload="fediverseComments()"attribute.
- with a
The script called by the iframe ensures the latter will always be resized based on content, saving the user from scrolling the iframe in addition to scrolling the blog page.
Example :
<!doctype html>
<html lang="en">
<head>
<script src="https://fediverse-comments.codeberg.page/src/fediverse-comments.js"></script>
</head>
<body>
<iframe
src="https://fediverse-comments.codeberg.page/src/main.html?urls=https://mamot.fr/@KaKi87/115244297818110707,https://jlai.lu/post/26123233"
onload="fediverseComments()"
></iframe>
</body>
</html>
| ▶️ Full demo |
|---|
Known issues
- One-click Lemmy commenting support is limited to top-level until
LemmyNet/lemmy-ui#3450is resolved.
Related projects
- Adding comments to your static blog with Mastodon —
carlschwan.eu, 2020-12-29- Using the fediverse/Mastodon for comments on blogs - Techno Barje —
techno-barje.fr, 2023-10-04 - Comment to a WordPress blog post via the Fediverse - @rolle / Web designer, web developer —
rolle.design, 2023-12-10 - Adding Fediverse Comments to My Static Site —
blog.nawaz.org, 2025-01-10
- Using the fediverse/Mastodon for comments on blogs - Techno Barje —
- nanos/1 - Mastodon Comments.md —
gist.github.com/nanos, 2023-02-14 - Client-side comments with Mastodon on a static Jekyll website - Jan Wildeboer’s Blog —
jan.wildeboer.net, 2023-02-25- Toot toot! Mastodon-powered Blog Comments ⋅ Cassidy James Blaede —
cassidyjames.com, 2023-07-06
- Toot toot! Mastodon-powered Blog Comments ⋅ Cassidy James Blaede —
- UppaJung/fediverse-comments: script to load mastodon posts into an otherwise-static webpage. —
github.com/UppaJung/fediverse-comments, 2023-09-12