Static sites with Jekyll

Static sites are making a comeback. People are starting to see advantages such as speed and security.

Jekyll is a simple, blog-aware, static site generator that is distributed under an open source license. Once installed and setup it means there is no need to worry about security updates for your site.

Popular CMS's like WordPress and Drupal are often attacked by hackers. WordPress in particular has been subject to a number of attacks. There are usually patches made available quickly to plug up the hole. WordPress has made minor updates to its core automatic to help users keep up to date. Most WordPress sites use 3rd party plugins to extend functionality, so it is important to keep them up to date too.

Jekyll solves that issue by stripping away all that.  It takes the engine off the web server. All the work on your computer. The only files that live on the server are the html and supporting CSS and media files.

Jekyll takes your source files and generates a whole static website. That site is then uploaded to the web server. It is fast and there is nothing to hack.



Set up and running

Setting up a Jekyll site can be a bit daunting for the uninitiated. Once done, there is very little else that needs to be done. It involves the following steps

  1. Making sure Jekyll is installed on the chosen computer.
  2. Set up the Jekyll loops and configuration files.
  3. Creating the template files.

Once the set up is complete, the next step is writing the content and maintaining the site.

  1. Write the content.
  2. Compile it to a static site.
  3. Deploy to a server.

Updating and maintaining content.

Updating and maintaining content  is relatively straightforward. You start your Jekyll server with the command "jekyll serve". Jekyll compiles the site to a directory called "_sites" and starts a temporary webserver, usually at

You then make the changes to your site. Jekyll generates the content and reloads a preview in the browser.

Once you've finished, upload the _sites folder to your webserver. This can be done with any FTP program.

Having said that, FTP can be quite inefficient because it uploads the whole file system. Spending time using rsync could make thing better in the long run because rsync only uploads the changed files. If you have a workflow based on a Node.js like Gulp or Grunt, you can integrate rsync into your workflow with Flightplan.js. Flightplan once configured will send your changes to the server for you.

Learning Markdown

The default setting for Jekyll is markdown. You can use plain html or jade with some changes. The default markdown is quite easy to learn. Once you've mastered it, it can be quite fast.  You end up with nice clean HTML. It just requires a little bit of practice. Here are a couple of basics:

Paragraphs are a simple press of the enter key.


# This is an


* Item 1
* Item 2

Numbered lists

  1.  apples
  2.  oranges
  3.  pears

Is Jekyll right for me?

A small to medium sized business that has a few pages such as an about page and few services pages and a blog would be ideal. It wouldn't work on a larger site with lots of products or an ecommerce site. A small brochure site would probably be overkill.



Posted in Technology on Jan 06, 2016