A DIY HTML Engine
Jekyll
Special Thanks: This article was made possible by support from Linux Professional Institute
Website development and hosting have come of age. Gone are the days of creating websites and blogs from scratch. Although blogging platforms and content management systems have many advantages, they still leave a lot to be desired. The benefits of do-it-yourself (DIY) website development still outweigh a packaged solution. Certain advantages are increased speed, lower or no hosting costs, security, and – more importantly – control over the flow of information and leaks that could happen by using rickety plugins or third-party infrastructure.
Jekyll started its journey in 2008, when a GitHub co-founder released the first build with an aim to provide a modern take on DIY website creation. A simple, static text-to-HTML site generator, Jekyll provides a robust engine to render simple text into attractive web pages, in addition to providing enough leverage for power users to tinker with the code.
The Jekyll advantage originates in its low overhead. Its Liquid renderer and Markdown support allow users to create websites using simple text and scripts to render a fully blown web page. The engine’s sophisticated design forms the backbone of GitHub Pages, so GitHub hosts Jekyll user websites for free.
Simplicity comes at a cost, however. Jekyll has made certain trade-offs to achieve an efficient design. The basic design flaw for website aficionados is the static design. Jekyll cannot render dynamic objects and does not allow the incorporation of a database, both of which tax resources and subsequently increase the cost of hosting a website.
In this article, I unravel the many aspects of Jekyll, from installing, understanding commands, configuring files, creating a project structure, managing the website, transferring it to your GitHub Pages user site, and tinkering with modular code.
Getting Started
Jekyll is written in the Ruby OnRails server-side web application framework; thus, your distro will not offer Jekyll packages directly. Instead, you should install the latest ruby and ruby-dev packages from your package manager. Jekyll usually requires the latest Ruby version. If your distro doesn’t offer the latest version, simply build it from the Ruby website.
Once the latest Ruby build is installed, use the following command to install Jekyll:
gem install jekyll
Now you can initiate the jekyll command directly from the terminal. Before I jump into the nitty-gritty of the setup process, though, I’ll take a look at the major feature set successive versions have brought to the table.
History
Jekyll started its journey with the first public release of 0.1 (Table 1). At that time, Jekyll lacked the charm of later iterations. Although major features were added in later point releases, the shot in the arm came with version 1. Developers abridged various features under simple commands to bring about a change in the overall user experience.
Table 1: Version Features
0.1–1.0 | 1.1–2.0 | 2.1–3.x |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Jekyll version 1 also saw inclusion of the ne w command, which generates a working skeleton of the website. Various compile tools were merged under build , serve , and migrate . A draft folder was added for convenience to manage and transfer drafts on the fly.
Version 2 further bolstered stability with added support for Sass, a CSS extension language, and CoffeeScript, a compiler that produces JavaScript. The introduction of collections paved the way for a unique variety of article types, in addition to generic blog posts and pages. The maruku Markdown interpreter was replaced by the kramdown Ruby-based Markdown converter.
Version 3 was more of an incremental, community-centric update that fixed many bugs and provided a much-needed grooming of the code. Several optimizations were made to enhance the user experience, speed, and resource utilization. The cherry on top was the implementation of incremental regeneration , which allowed Jekyll to update a website automatically without having to rebuild the entire project. Any changes or additions to files (barring _config.yml ) now are automatically updated to the local server. With a simple refresh of the web page, changes are visible on the fly. This nifty addition saves countless CPU cycles that would be needed to rebuild a project, even for a tiny change.
Jekyll releases are disruptive in nature, which can break your existing project. The rolling release keeps dropping support for older Ruby versions, which makes the whole process uncertain. Additionally, constant syntax changes and a new scripting engine keeps you on the edge to learn and implement cutting edge features.