Bhread updates
This is a thread for Bhread’s new features.
This is a thread for Bhread’s new features.
[ - ]
replying to Bhread updates.
Bhread now provides a piece of code you can put on your site that will display replies from all of Bhread.
This feature will also work if the user doesn’t have JS enabled.
Copy this code:
<script>
// Wait for bhread to send a message to resize
window.addEventListener('message', function(e) {
/* This code adjusts the comment section to its full height.
** You may omit this if you're okay with a scrollable comment section.
**/
const commentsSection = document.getElementById('bhread-comments');
// Only show comment section if it loads successfully.
commentsSection.style.display = 'block';
const eventName = e.data[0];
const data = e.data[1];
switch(eventName) {
case 'setHeight':
commentsSection.setAttribute('height', data);
break;
}
}, false);
</script>
<iframe id="bhread-comments" src="https://bhread.com/comment-embed/{{ absURL .Page.RelPermalink }}" width="100%" height="350px" frameBorder="0" onload="this.style.display = 'none'" loading="lazy" style="border-radius: 5px;"> </iframe>
In Hugo, find the template or page that’s used for single articles. Paste this piece of code after the content section or anywhere you’d like to display the comments in the page.
This will add an iframe
element to your posts with 350px height.
Here are some things to note:
How it looks like without replies. You can probably also look at this post you’re reading and find the comment section
With a single reply
In the future, we aim to add more (and better) instructions for integrating this to other site makers (Wordpress, Jekyll, etc) we also aim to add customizability options for comment embeds like link colors, and setting the background color.
Stay tuned by subscribing to the Feed! 8)