Sneaky.NET

Tom’s Home page

Octopress Customizations

These are some of the things I’ve done to make Octopress work the way I wanted it to. You’ll notice several pictures through out the page. You can click on any of them and you should get a gallery of all of them.

Categories in the Atom feed

It would be nice to include the categores that I use for posts so things are easier to find.

1
2
3
4
5
6
<entry>
  ... other elements ...
  {% for category in post.categories %}
    <category scheme="{{ site.url }}/categories/" term="{{ category | replace: ' ','-' | downcase }}" />
  {% endfor %}
</entry>

This code block caused quite a few problems. The site.url above as causing liquid to bomb out. Still tracking back why.. shouldn’t it know about the backticks? Ok, I figured it out. The problem is that I’m including liquid syntax in the codeblock. I incorrectly ASSuMEd that it would not try to parse the text betweenthe code blocks - only highlight it.

Once I added a {% raw %} block around it, life was good.

Categories Index Page

Another good idea Erv had was to create a categories index page. I’d like a tag cloud, but that is a “down the road” thing for me. I downloaded the category_list.rb file and place it in the plug-ins directory.

Follow the directions at: ocotpress-category-list

I only put the category_cloud into the default_asides array. Didn’t need both. (Obviously, whichever one you include.. that’s what gets rendered.)

FancyBox

Once I fixed the “raw” issue above, I just followed the directions on this one. (See the linked page at the bootom.)

I downloaded fancyBox. I placed jquery and jquery.fancybox.pack.js files into the javascript directory and the jquery.fancybox.css file into the sytlesheet directory.

  1. Add a reference to jquery.fancybox.css in ./source/_includes/custom/head.html
  2. Add a reference to jquery.min.js (if it is not already there) in ./source/_includes/custom/after_footer.html
  3. Add a reference to jquery.fancybox.pack.js in ./source/_includes/custom/after_footer.html

I had quite a few issues getting this one going. The biggest problem was figureing out where to put the javascript. I finally managed to get it working by putting the javascript into a new file called sneaky.js. I then loaded that with the jquery.fancybox.pack.js above in after_foot.html.

Here’s the javascript:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(function($){

  $('.entry-content').each(function(i){
      var _i = i;
      $(this).find('img.fancybox').each(function(){
          var img = $(this);
          var title = img.attr("title");
          var classes = img.attr("class");
          img.removeAttr("class");
          img.wrap('<a href="'+this.src+'" class="' + classes + '" rel="gallery'+_i+'" />');
          if (title != "")
          {
              img.parent().attr("title", title);
          }
      });
  });
  $('.fancybox').fancybox();

})(jQuery);

Discus

I just signed up and.. Well, that was easy. It really was as simple as adding my short name to the _config.yaml file and generating and deploying.

Google Analytics

Yes, it too was as simple as adding my UA* property ID to the _config.yaml file and then regenerating and deploying.


Most of these came from another Ocotpress octopress site. (I’m lazy.)

Comments