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 When I thought about doing that for my blog I decided that I didn’t want to get into the social issues and copyright issues this could involve. I just didn’t want to get involved into those discussions. I hope it works out for you. 😀

@kensanata Absolutely understandable. I tend to be more relaxed on this issue in this case. Toots are public, distributed across a unknown large number of Mastodon, GNU Social and Friendica instances. Cached by search engines, archived by archive.org so I don't see a problem by showing it on my homepage as well. It is also "just a live search" when you open the page. Nothing is stored and if someone deleted a reply it will disappear on my page as well. So I feel fine with it.

@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 @bjoern yeah something like this but without the php would be pretty damn nice

@mooshoe
You could probably do it completely in JavaScript but then you might run in CORS issues, depending on how the Mastodon server is configured. That's why I decided to do the Mastodon API calls server side.

Cc @codesections

@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.

@bjoern
Do you plan to integrate this code in a WP plugin? If not, I am interested to have a try for doing that.

@tom79 as I don't use WordPress I will probably not turn it in a WordPress plugin. But it should be straight forward. Additionally you probably need to make some URLs/strings configurable which I hard coded in order to get it finished quickly yesterday and provide a small configuration page for WordPress. Would be awesome if you would try it. Let me know when you did it! 🙂

@bjoern
Ok. Thanks, I will try to build this plugin :)

@tom79 Let me know if you need any help. I'm happy to give feedback, explain my code, etc of needed.

@tom79 @bjoern I would be interested in a wordpress plugin for this! I really need to sit down next weekend and work on my website. I have some overdue posts I need to write, starting with why I will no longer buy Dell XPS.

@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

Sign in to participate in the conversation
Mastodon

Follow friends and discover new ones. Publish anything you want: links, pictures, text, video. This server is run by the main developers of the Mastodon project. Everyone is welcome as long as you follow our code of conduct!