Micro.blog

manton
manton

We announced Conversation.js this week and focused on how easy it is to enable on Micro.blog, but it actually works on any blog. Here’s a post from Vincent Ritter using it, even though his blog is hosted somewhere else.

colinwalker
colinwalker

@manton You're missing the close quote after ?url= on the conversation.js help page. Just in case you hadn't noticed and someone tried copy/pasting.

frankm
frankm

@manton I confess that I still find the process confusing. From what I read I think you can only enable replies in micro.blog if you are using a specific template, which I am not using. I've clicked the checkbox to enable replies but I never see any, so I clearly need to do more.

manton
manton

@frankm If you have a custom template, you can add that line of JavaScript from the help, usually to single.html below your post. I didn't want to automatically edit any templates you've customized.

frankm
frankm

@manton Actually, I am using the default template, but I did add things to the footer. I've just ticked the check box again to see if that works.

frankm
frankm

@manton Never mind... I guess it was operator error.

hall
hall

@manton I’ve added the javascript to my single template, but it's throwing:

Theme error: Error building site: failed to render pages: render of "page" failed: execute of template failed: html/template:post/single.html: ends in a non-text context: {stateURL delimDoubleQuote urlPartQueryOrFrag jsCtxRegexp attrURL elementScript }

manton
manton

@hall Part of the script was truncated in the previous version of the help page, so make sure you've got the latest version. If it still doesn't work, email the template to help@micro.blog because it's difficult to debug here. Thanks!

hall
hall

@manton Ah, missed that - thanks 👍

mikehaynes
mikehaynes

@manton @Vincent Do you have a write-up on how to get this working on non-MB sites? I know you mentioned a couple different things you used but that went a little over my head. 😂

In reply to
endonend
endonend

@mikehaynes @manton @Vincent for WordPress I just put the JS from Manton's post in my single post template, wrapped it with the default WordPress comment divs, and even used Manton's CSS. Here's an example output: endonend.org/2020/02/1... (the top Join the Conversation... area) -- want to add more styling eventually.

mikehaynes
mikehaynes

@endonend Oh, I actually just had to adjust the code a bit to add my full url (I'm using Jekyll) but I have it working now on my local build! Very cool!

endonend
endonend

@mikehaynes awesome! Yeah forgot to mention I had to use WP permalink code in JS. Glad you got it working.

mikehaynes
mikehaynes

@endonend Yeah, super easy, even without having a site on MB. Crazy easy to style it too. Ie: mikehayn.es/link/batm... Thanks for adding this functionality @manton!

vincent
vincent

@mikehaynes Looks like you managed to get it to work! Looking really really good 👍

hall
hall

@manton Is there an element I can isolate in my micro.blog hosted timeline, to signify a Conversation, which I can then either put an icon on or reveal “Conversation” so people can then go through to that conversation on the Post page. Otherwise how do folks know which posts have chat? Similar to the way the official mb timeline reveals the Conversation link.

manton
manton

@hall That would require writing a little JavaScript snippet right now that gets run for each blog post. It can pull in the conversation and if there is at least 1 reply, add a link similar to what Micro.blog does. I can try to put an example together for the help page.

hall
hall

@manton That would be great! Thanks.