Follow

I use now to enable comments and to show likes and reshares on my otherwise static webpage. I wrote a small JavaScript and PHP script for it which you can find here: gitlab.com/BeS/hugo-sustain-ng Feel free to reuse it. 🙂

@bjoern Why is the comments counter still at 0, but Balu write a post?

@funqr Just checked it. The API returns '0' and also on Mastodon the reply count is '0', see mastodon.social/@bjoern/100148 Seems to be a Mastodon bug?

@bjoern This is super neat, and I love the way you've integrated the share buttons (I need to sit down with my own website sometime soon and update it) but note: the icon doesn't show up on the article and I don't think I'm seeing all of the replies :)

@eleanor Which icons do you mean (maybe you have a screenshot?) and do you have a example of a reply which should be there but doesn't show up? Looks everything good here, as far as I can tell.

@bjoern Ignore the comment about the reply; I realize now that the reply was using the username because it was replying to YOU.

But the icon screenshot is here: snag.gy/R46EY9.jpg

@eleanor Ah, the avatar. That's strange. I tried it with different browsers, in private mode, etc it always works here. The image comes directly from the Mastodon server. Maybe a browser caching issue on your side? Can you check the URL of the broken avatar. This should be the URL files.mastodon.social/accounts

@bjoern It works fine at work but not at home. Not sure why that would be.

@bjoern

This looks really cool. I don't know PHP—what all are you doing server-side? Do you think it'd be possible to do it all with client-side JS? It seems like it should be possible, though it might be a little slow (and I guess you'd lose your comments if the instance were down…)

Might play around with that one day.

@codesections
On the server side I do all the API calls to the Mastodon server to find the toots, replies, favs and reblogs. You could do this also with JavaScript but you might run in CORS issues. If you maintain your own Mastodon server you can configure the webserver so that it is allowed. But for most 3rd party Mastodon server it will probably not work. Most server restrict Cross-Origin Resource Sharing for security reasons.

@algorev I know it. There are quite some interesting approaches to bring comments to static webpages. Why I decided against this particular solution: I don't wan to ask my visitors to signup at a centralized and proprietary service to add a comment. I prefer to advertise free, decentralized, federated and open solution. 🙂

@bjoern @algorev i installed isso two months ago but i could consider migrating to this.

@lord I also used isso before, great project! But I wanted to get rid off the additional server component. I also liked the idea to advertise the fediverse this way.

Cc @algorev

@bjoern @algorev exactly !

I'd even go farther with a script or else being able to get the comments and save it in the static blog (in the frontmatter or a separate file).

@bjoern cool stuff! No more disqus for comments on static pages!

@bjoern Cool! Was talking just a few days ago about wanting something of this sort.

@bjoern This is cool, would love to see somthing like this as an option for @write_as

@bjoern This looks amazing. I've been trying to implement it on my own site - without much success (due to my own deficiencies).

The JS is getting stuck because RelPermalink is undefined. Where is is looking for this term and for what purpose?

I assume also that this line in 'getcomments.php' would reference the config file in the mastodon-comments dir, as the provided address isn't in your repo?

require_once '../../mastodon.feed/config.php';

@bjoern Blind perseverance has got me somewhere (which should be a compliment to your code because I know nothing of PHP) - I think I'm just struggling with the credentials now because I'm getting a blank JSON return from getcomments.php.

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!