@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;
@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.
@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. :(
@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).
@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:
<ul class="replies" id="replies"></ul>
<ul class="likes" id="likes"></ul>
<ul class="shares" id="shares"></ul>
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….
@bix I imagine there could be. I'm happy to keep the home page clean though.
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….