Thanks to @shindakun and the clearly written tutorial at Adding Webmentions To micro.blog I believe Iāve now successfully added Webmentions to this blog. š¤š¼
Thanks to @shindakun and the clearly written tutorial at Adding Webmentions To micro.blog I believe Iāve now successfully added Webmentions to this blog. š¤š¼
@Miraz awesome! I do need to tweak some small bits but I'm glad what's there already has been helpful!
@shindakun Iāve done some CSS and other tweaks and have it looking more to my liking. I'd like to get rid of the Like and Share buttons totally, but when I removed them from the HTML everything broke. š meanwhile I'm hiding the text. I also rearranged a couple of items. So pleasing. Thank you again.
@Miraz Yeah I've been thinking about getting rid of the buttons myself. If you remove the label section near the top of the "render" functions that should allow you to remove the HTML for the buttons. For example:
var label = reposts.length + (reposts.length === 1 ? ' share' : ' shares');
document.getElementById('share-count').innerHTML = label;
Thanks @manton adding something other then webmentions seemed wrong somehow lol. The online theme editor made it pretty easy to step through the process too.
@Miraz I tested sending a webmention from my external blog, it didn't seem to come through despite it appearing on micro.blog. I wonder what's going on, I'm guessing I didn't link it correctly or something.
@matpacker I've been outside for a couple of hours. Looks like my most recent edit to the files has broken itā¦ Iāll look at it again tomorrowā¦
@Miraz Ack! Looks like I left out <ul class="shares" id="shares"></ul>
in the HTML on the post. I also noticed I didn't mention that you need to supply an image for shares. The code looks for /images/anon-avatar.png
by default.
@matpacker There is something odd about the post that webmention.io recieved, looking at the JSON returned to the page its coming in as:
"sentence_html": "<a href=\"[www.mathewpacker.com/2019/12/2...](https://www.mathewpacker.com/2019/12/2523/)\">someone</a> posted '' linking to <a href=\"[miraz.me/2019/12/2...](https://miraz.me/2019/12/21/thanks-to-shindakun.html)\">[miraz.me/2019/12/2...](https://miraz.me/2019/12/21/thanks-to-shindakun.html)</a>"
So, it knows you send something just doesn't appear to have written the text.
Thanks for testing that, I had completely forgotten about it.
@shindakun Curious! I'm using WP with the webmentions plugin, I've just updated the post with more information added to the response property, I wonder if it's sent the update message and if there's any additional info in it.
@matpacker Hmm doesn't look like it's updated in the data sent back to the page (at least not yet). I haven't used that plugin, so I don't know to much about how its sending to webmention.io that mention definietly is much ligher on details then the ones from micro.blog. I wonder if that's why the original implmentation I based my post on only shows a name and profile icon for "shares". Though the other examples of them I found do appear to have comment text. Maybe the issue is specific to the plugin, can't install it on the free wordpress.com account. :(
@Miraz I've been trying this out myself. Webmentions are working but they're not being shown and the buttons don't do anything. A bit more tweaking might be needed for my theme.
@bix Yes, I think you're right. If you switch to using another Webmention endpoint, Micro.blog will know about Micro.blog replies but not necessarily external replies (unless they are also sent to Micro.blog, which I think a couple bloggers do).
@toddgrotenhuis We plan to have a built-in feature that can do something similar in the future, so I wouldn't want everyone to have to switch later. But it's an option for people who need that functionality right now.
@shindakun Will you be updating your original post? I've favorited it and plan to add webmentions to my mb in a few days. So I'm glad people have started testing it out :)
@pratik yup the plan is for some more updates today. Think I'm going to take the buttons out completely the original implementation only would show one type of mention at a time but I don't think that's necessary.
@stefp I had it working yesterday, then tweaked something and it broke. Even after undoing the tweaks I canāt seem to get it working again. š
@Miraz it looks like you should be alright once you add the "shares" <ul> .
It got left out of the HTML in my original post by mistake, it should have included three elements:
html
<ul class="replies" id="replies"></ul>
<ul class="likes" id="likes"></ul>
<ul class="shares" id="shares"></ul>
@shindakun Thank you. Webmentions are now appearing. The thing is, they're appearing again. They did work yesterday, then stopped with my messing about. Anyway, there are now a load of mentions on the post. Thanks again!
@Miraz so, my blog has sent 3 webmentions now, no text has come through from any of them, Iāve sent 2 of them using the response properties fields that the Post Kinds WP plugin adds, and the other was sent using @aaronpkās Quill app.
FYI @shindakun
@Miraz I've managed to get it working after a lot of fiddling around. The problem was the path to the javascript file was wrong. I think I just found the right one by luck :)
@matpacker hmm that stinks. :( Wonder webmention.io is not reciving something it expects? I don't really have a good way to test that but I'll try and come up with something.
@shindakun yeh, itās an odd one, got a couple of other things to test before leaving it for today.
@pratik Yes, I think the thing is designed to only go on pages for single posts. Imagine if a Home page had dozens of 'comments' on each post. I wouldn't like that much.
@bix @Miraz @pratik I believe the JS to talk to webmention.io keys off of the current URL, so on the homepage itād just show everyone whoās ever sent a webmention to the homepage.
I imagine a variant could be written that finds the permalink URL for every post on a page and then goes and asks webmention.io for a count, for each post, and displays that with the post on the homepage, but itās probably that much more complexā¦.
@pratik @bix ā¦Although maybe not that much more complex, since @shindakunās original JavaScript implementation already had the counting stuff (as seen on @Mirazās site)ā¦youād just have to look for the URLs differently (looping through all the posts on the page), grab the count(s) for each URL, and put them in a different div
placeholder, and then youād have counts with each post on the homepage. So maybe 80% of the JS is the same?
@matpacker @shindakun I just noticed that Mirazās post is reporting ā4 sharesā (and wondered what they wereā¦), which coincidentally corresponds to 4 āspeaking headā icons from mathewpacker.com, so webmention.io is seeing them as shares and not replies, I guessā¦if that helps any in debuggingā¦.
@matpacker Ah, good š