Setting up Jekyll blog on Ubuntu subsystem for Windows 😵

Whether you are a fan or not, the Ubuntu subsystem for Windows is here to stay. Personally I am a fan as it puts an entire Ubuntu operating system at your fingertips without the need to set up a Virtual Machine. At the same time, it integrates pretty well with the Windows environment, allowing you to easily access the file system.

One thing that I have found, this is very useful for, is leveraging the power of Apititude. This package manager that comes preloaded with Ubuntu (and many other Debian based operating systems), makes it very easy to install open-source tools which on Windows typically require you to download and install them manually and often suffer from issues caused by the subtle differences between operating systems.

A while ago I decided to check out Jekyll. It is a Ruby-based platform which converts Markdown based files into static websites or even blogs. The big advantage of such websites is that they are very easy for a webserver to server up, as they require very little logic on the server to be executed. Essentially you are just reading a file from the filesystem and sending it through the HTTP socket to the requester. With a good caching system, these pages can even be served up directly from the memory of the server.

Setting up

The Ubuntu subsystem for Windows is fairly lightweight. So a lot of packages will not come pre-installed. This means that before you can follow the default instructions to start a new Jekyll project, you will have to set up some prerequisites.

These commands will install Ruby and the tools required to build Ruby gems. Next we will install the Bundler and Jekyll gems, which are needed to set up, build and serve your Jekyll based website.

Your Ubuntu subsystem should now be set up and ready for you to develop your website.

Your Jekyll project

As the prerequisites are now out of the way, it is time to follow the remaining setup instructions as they are given on the Jekyll website itself. The following commands will set up a basic project fro your website, build it and also serve it.

Your website should now be available at http://localhost:4000/ and update live when you modify it! All of the tools for editing on your Windows machine, you can now use to edit the website, even though it is being served by the Ubuntu subsystem.

Read More