Totally Random Musings from the Edge

Recent Comments as an Asides

11 January 2013

This article will take 1 minute to read

This short tutorial will teach you in creating a “Recent Comments” asides for the Octopress sidebar if you’re using Disqus as your commenting system.

Step 1: Let’s create a new aside. Create a new file named recent_comments.html under source/_includes/custom/asides Step 2: Add the following code

  <h1>Recent Comments</h1>
  <div id="dsq-recentcomments" class="dsq-widget"><script type="text/javascript" src="http://disqus.com/forums//recent_comments_widget.js?hide_avatars=1"></script></div>

Here are the parameters you can use for comments :

  • hide_avatars : hides the avatar in comments (values : 0, 1)
  • num_items : number of comments to show
  • excerpt_length : number of characters to show for each comment

Step 3: Add the aside to _config.yml

default_asides: [custom/asides/links.html, asides/recent_posts.html, custom/asides/recent_comments.html, asides/github.html, asides/twitter.html, asides/delicious.html, asides/pinboard.html, asides/googleplus.html]

Step 4: Rebuild your site

rake generate && rake deploy