Creating a better website with Jekyll, Foundation CSS and Nginx
As I've not updated this site in well over a year, and do not feel particularly attached to any of my old content, I recently decided to delete the old site and start from scratch. Also, I've gotten tired of always updating my WordPress installation. This, along with the fact that I'm sufficiently paranoid that I worry about having a database and server-side code running on my VPS, seemed like the perfect excuse to play with some new tools that I've been meaning to try. In this post I'll outline the tools I used to create crashsystems.net 2.0.
The best way to describe Jekyll is that it is like having a WordPress theme without the the rest of WordPress, and without having to bother with writing PHP. Templates are created with the Liquid templating language, and content is written with Markdown, a simple system for expressing content formatting in plaintext. Jekyll converts the Markdown content to HTML, runs the Liquid templates to assemble the site, and then outputs static HTML.
This setup has several advantages, the first being security. Since I'm not running a database server or any server-side scripting language on this site, there is much less for an attacker to target. Secondly, not running database queries means my site runs much faster. Theoretically, my site performance is only limited by the web server I'm running (more on that in a bit), disk I/O and connection throughput. Thirdly, my content is plain text stored in files, so I can edit it in any program I want, and I don't have to worry about database backups.
Foundation is a CSS framework for creating responsive website layouts, meaning that one site template can automatically adjust to varying device form factors. Basically, I created this layout for desktops, and got a mobile site automatically, with no extra effort. In addition to simplifying the development of layouts, Foundation also abstracts many of the tedious aspects of using CSS. I'm far from being a graphics designer, but with Foundation I was able to quickly construct a decent site design.
Apache is a very versatile web server, but it also seems somewhat slow and resource intensive. After I did some research, I found that the Nginx web server seems to be one of the fastest servers, especially for serving static content. The Nginx installation process was quite simple, and this guide was quite useful for performance tuning the server.
The source code for my site can be found on GitHub. Now that the site is set up, I plan on posting somewhat more frequently, about technology, information security, crypto and perhaps a bit of photography.