Changed Permalinks and More Blog Tweaks

I'm really liking Jekyll as a blog engine, and have been tweaking a few things on the site. One big change is permalinks. To follow Jekyll's preferred convention, I've switched my post's permalinks from /blog/YYYY/MM/DD to just /YYYY/MM/DD. Thanks to Apache's mod_rewrite, old links will still work, but I find mod_rewrite rules a bit of a dark art. So, for convenience and future reference, here are the rules I've used:

# .htaccess

RewriteBase /

# Don't redirect if URL is a real file

RewriteCond %{REQUEST_URI} !-f

# Redirect requests for /blog/some/page.html to /some/page.html

RewriteCond %{REQUEST_URI}% ^/blog(.*)

RewriteRule blog/(.*)$1 [R=301,NC,L]

# Redirect requests for /feed to Feedburner

RewriteCond %{REQUEST_URI}% ^/feed/?(.*)

RewriteRule ^(.*) [R=301,NC,L]```

For now, the changed permalink structure means that [Disqus](( comments are not available. I've contacted [Disqus]( about this though, and hope to move those comments to the new format soon.

In the meantime, everything else seems to be running smoothly on Jekyll. I've tweaked my site's design back to a fairly minimal theme - [influenced]( by [other]( Jekyll [sites]( that I've seen.

I've kept deployments simple too; rather than using git hooks, I use a Rakefile and rsync combination based on [this post]( The Rakefile lets me use [a fork of Jekyll]( to compile and upload the site with a simple call to `rake deploy`:

```ruby# /Rakefile

def jekyll(opts = "", path = "../jekyll/bin/")

  sh "rm -rf _site"

  sh path + "jekyll " + opts


def rsync(options = {})

  options = {

    :domain => 'servername',

    :deploy_to => 'filesystem path',

    :port => ssh_port,

    :user => 'ssh_username'


  sh "rsync -rtz -e 'ssh -p #{options[:port]}' _site/ #{options[:user]}@#{options[:domain]}:#{options[:deploy_to]}/"


desc "Perform a jekyll rebuild of the site"

task :build do




desc "Serve on Localhost with port 4000"

task :local do

  jekyll("--server --auto --limit-posts 5")


desc "Rebuild and Deploy to Live"

task :deploy => :build do




desc "Deploy the currently cached build to Live"

task :cached do




namespace :sitemap do

  desc "Rebuild the sitemap.xml using gen_sitemap.rb"

  task :build do

    generate_sitemap_bin = File.dirname(__FILE__) + "/_tools/gen_sitemap.rb"

    cmd = "cd _site && ruby #{generate_sitemap_bin} '.' > sitemap.xml"



  desc 'Notify Google of the new sitemap'

  task :ping do

    require 'net/http'

    require 'uri'



        '/webmasters/tools/ping?sitemap=' +





Overall everything feels a lot lighter and easier to manage, and vim now sits at the heart of my blog workflow. This is great as I find it hard work to use any other text editor since learning vim. Static HTML means the site is served quickly as well, and I feel safe in the knowledge that my data is stored in a `git` repository rather than a single database.

One caveat is that the site can't include external dynamic content; at least not without some Javascript. I figure, though, that there are plenty of ways to follow [my Twitter ramblings]( or [photostreams]( and so on without adding distraction to the site.

So hopefully the transition is complete. Once the Disqus comments are linked, I'll be able to get back to writing some content to fill the blog! There's plenty to write about, with the recent release of [Rails 3 beta](, and my upcoming travels. I'll also document more about [Amberleaf]( "Amberleaf")'s development, post more Rails tips as I learn, and discuss a new mobile app for Android I'm starting.

Are you using [Jekyll]( or something similar to power your site? How have you found the transition if you've switched from bigger engines like Wordpress or Mephisto?