Trouble with Conversation.js

Hi! I’m trying to get conversations/webmentions showing on my blog. I have checked out this article: Replies with Conversation.js and have the checkbox checked. Unfortunately I’m getting a 404 on conversation.js loading on my site. Any ideas on how I can fix this?

Here is what it’s trying to fetch for one of my posts - https://micro.blog/conversation.js?url=https%3a%2f%2fheyloura.com%2f2022%2f11%2f08%2fawww-the-cats.html which looks correct …

Howdy.

Just had a look at this.

I can see it working on your site here - it’s the Tai Chi article.

You can see it working if you try this:

https://micro.blog/conversation.js?url=https://heyloura.com/2022/11/10/nothing-like-a.html

If there are no replies to other posts, it won’t return any “posts” as such, so that’s why you’re encountering the error message.

Hey Loura! Have you recently moved your blog from heyloura.micro.blog to heyloura.com? Looks like your smart-cats-being-smart post was published before you activated your custom domain. Conversation.js sometimes gets confused when moving from one domain to another.

Theoretically, one could work around this problem by hacking around in your blog’s template and modifying Conversation.js. But it’s a bit involved. @mantion has mentioned before that he thinks Conversation.js could be improved upon.

@sod that makes sense. I was waiting on moving my domain over while I was deciding if I wanted to commit to micro.blog. So I had a bit of activity under heyloura.micro.blog. Thanks for the explanation! I might try messing around with my theme to see if I can fix it (maybe fetching heyloura.com and if it fails trying for heyloura.micro.blog) and see if that works. If I manage to get anything working I’ll post it here for others to find.

That’s a great idea. If you want to avoid the extra request, an alternative approach might be to figure out the post’s published date and make a decision based on that.

const publishedDateAsText = document.querySelector('.dt-published').textContent;
const publishedDate = new Date(publishedDateAsText);

// And so on…