thoughts on code, tech and life.

Three Octopress Tweaks

I’ve just updated Octopress to the latest and greatest version, including re-applying my various customizations. So, now that I happen to have them all in one place, here are three quick ways I’ve improved the base Octopress install:


Filter some repositories from GitHub sidebar

If you’re hosting your Octopress blog on GitHub Pages, it’s kind of pointless to have that repository show up in the sidebar, especially since it doesn’t contain anything particularly interesting.

But you can also use this tweak to hide that secret project you’re working on… or that old, embarrassing one that never did work quite right.

@@ -67,6 +67,7 @@
         github_repo_count: 0
         github_show_profile_link: true
         github_skip_forks: true
+        github_skip_repos: []  # list of repos to hide from the sidebar. ex: [blog,, old_embarrassing_project]

@@ -21,6 +21,7 @@
             user: '{{site.github_user}}',
             count: {{site.github_repo_count}},
             skip_forks: {{site.github_skip_forks}},
+            skip_repos: [ {% for repo in site.github_skip_repos %}"{{repo}}"{% unless forloop.last %}, {% endunless %}{% endfor %} ],
             target: '#gh_repos'

@@ -21,6 +21,7 @@
           if (!data || ! { return; }
           for (var i = 0; i <; i++) {
             if (options.skip_forks &&[i].fork) { continue; }
+            if ( jQuery.inArray([i].name, options.skip_repos ) != -1) { continue; }
           if (options.count) { repos.splice(options.count); }

Limit Pinboard sidebar to a specific tag

I bookmark a lot of things on Pinboard, most of which aren’t exactly technical in nature. Here’s a quick change that lets you save bookmarks with a specific tag (I use “blog”) to show them on the sidebar.

And since we’re here anyway, may as well also change the header and loading text (I don’t know why, but I’ve never liked the word “linkroll”). I also removed the tags to make it less cluttered.

        # Pinboard
        pinboard_count: 5
+       pinboard_tag: blog

@@ -1,13 +1,14 @@
-  <h1>My Pinboard</h1>
-  <ul id="pinboard_linkroll">Fetching linkroll...</ul>
-  <p><a href="{{ site.pinboard_user }}">My Pinboard Bookmarks &raquo;</a></p>
+  <h1>Bookmarks</h1>
+  <ul id="pinboard_linkroll">Fetching bookmarks...</ul>
+  <p><a href="{{ site.pinboard_user }}/t:{{ site.pinboard_tag }}">see more &raquo;</a></p>
 <script type="text/javascript">
   var linkroll = 'pinboard_linkroll'; //id target for pinboard list
   var pinboard_user = "{{ site.pinboard_user }}"; //id target for pinboard list
   var pinboard_count = {{ site.pinboard_count }}; //id target for pinboard list
+  var pinboard_tag = "{{ site.pinboard_tag }}";
     var pinboardInit = document.createElement('script');
     pinboardInit.type = 'text/javascript';

@@ -41,16 +41,16 @@ function Pinboard_Linkroll() {
     if (it.n) {
       str += "<span class=\"pin-description\">" + this.cook(it.n) + "</span>\n";
-    if (it.t.length > 0) {
-      for (var i = 0; i < it.t.length; i++) {
-        var tag = it.t[i];
-        str += " <a class=\"pin-tag\" href=\""+ this.cook(it.a) + "/t:" + this.cook(tag) + "\">" + this.cook(tag).replace(/^\s+|\s+$/g, '') + "</a> ";
-      }
-    }
     str += "</p></li>\n";
     return str;
 Pinboard_Linkroll.prototype = new Pinboard_Linkroll();

If you want to do this for Delicious, it’s even easier.

Move the Archive page to /archive

Even if you have Octopress set to use the root directory, it defaults to putting your post archive under /blog/archive. I found the fix in this post:

  • Move source/blog/archive/index.html to source/archive/index.html.
  • Update navigation links accordingly, in source/_includes/custom/navigation.html and source/index.html. (Note: the example given is inconsistent; whether you’re using “archive” or “archives”, just ensure all the links match the directory name!)

I was originally planning to wrap this post up with a mention of prettifying code snippets, but that turned out to be a bit of a project, so I think it deserves its own post.