Although it wasn’t easy I finally migrated my blog over to Jekyll. Personally I have nothing against the fantastic work of software that is WordPress it really helped a lot of people all across the world get into blogging and sharing their thoughts but WordPress is at its heart a CMS. Although commonly used to host blogs WordPress is greatly under-utilized as a blogging platform and many of its features become rather obtrusive from a single users perspective.
Quite some time ago(early 2010) when I just began programming I had learned that it was a fairly common practice amongst programmers to keep an update code blog.
Not knowing anything at all about web development or even what PHP stood for I did what most people assumed when they heard the word blog and jumped on WordPress.
Although there is nothing wrong with using WordPress for a blogging platform, as a developer I quickly realized that I was not the targeted audience.
My old programming blog morphed into a nasty mashup of copy pasted code and I used all sorts of weird blog publishing software and quirky online editors just to update a single post on my site.
I could remember it taking me several hours just to go from writing new content to finnally displaying on my code blog just because I knew nothing about how content was actually served on the web.
I can’t exactly remember when it was that I was browsing online one day for WordPress tutorials when I spotted a comment on a blog post that said something along the lines of “Do you really need a database connection just to fetch blog post which probably won’t ever be updated after you’ve written it?”.
Something about that kinda pissed me off… I was thinking to myself “You know… why the heck do I need user auth and an entire content management system which I probably only use about 2% of its entire features anyways just to render some damn static html on a screen?”
However given my skillset at the time(all I knew was C++ and a tiny sliver of HTML) I couldn’t imagine writting every single line of HTML by hand and having to go through and update every single link on the site; not only would it be absurd but the sheer amount of wasted time could have been invested into just paying someone to build a site for me.
In the meantime I had just discovered the wonders of version control and Git in particular when I came across an article about how GitHub.com handles its myraid number of web pages.
It was something called Jekyll, a blog aware static site generator.
The basics of Jekyll are easy enough to figure out, you design a layout and run some ruby code to render all of your post which fit neatly into the
_post directory of your app.
From there you run the command “Jekyll” at the terminal at the root directory of your application and the
_site folder is generated.
Next you copy the
_site directory to a web server and you’re done.
As you can see from the github source for this blog the main layout is where all parts of the Jekyll app come together.
When you yield for the content you then tell your individual pages which layout to use.
Once selected within the page yaml as you can see below you use Jekyll’s builtin post macro for accessing the yaml you describe inside of each post.
In addition you can add your own custom post yaml such as the post.mydate which formats the post’s date a bit differently from the default post.date.
From my perspective at least, getting up and running with Jekyll was simple and easy compared to having to learn about an entire database query language(MySQL) before you can access your posts.
Despite all of my cheerleading and praise I admit Jekyll was a bit confusing at times due to the usage of the liquid templating engine.
I had to sit down for a few hours and did through some documentation and browse source code of existing Jekyll blogs in order to understand the finer points of how pages are rendered from templates.
Even more confusing was that since HTML is readily generated when the
Anyhow I’ve talked way too much in this post already… enjoy your static site produced with Jekyll.
(NOTE: I realize that you can’t compare an entire CMS to a static site generator but I’m only comparing them from a blogger’s point of view)