Even though I so far love learning Ruby I’ve had hard time to find a project to work on. All the things that I wanted to code have already been done which makes my motivation crumble. I know that I can code something that already been done and it would probaly be a good experience, but I’m lazy like that. After some thinking I finally came up with something and yesterday I “released” it: the Jekyll Rake Boilerplate.
Using a rakefile for Jekyll isn’t something that’s new nor unique but so far I haven’t stumbled upon a simple boilerplate. It isn’t revolutionary by any means1 but it gave me the motivation that I needed and I had fun while doing it. Even though it’s a small file I actually both tested and experimented with it quite extensively. It may sound silly but I wanted to be “proud” of it, or atleast content.
The Jekyll Rake Boilerplate consists of four tasks:
buildgenerates the site. If I want to generate it with a post limit, I can use
buildor whatever number of posts I want to generate.
post["Post title"]creates a new post in the
_postsdirectory by reading the default template file, adding the title I’ve specified and generating a file name by using the current date and the title.
git["Commit message"]adds, commits and pushes the site to the site’s remote git repository with the commit message that’s been specified.
rsyncto transfer the site to a remote host/server.
I also set the default task to
build so if I’m feeling lazy I only need to
Enter and the site will be generated. I’ve contemplating
about adding some more tasks but for now I’ll stick to what I already have. The
goal is to keep it as simple and adaptable as possible so that anyone can use it
without having to modify it too much unless they want to.