Emerson's Site

Developer/Sysadmin, college kid, musician, etc.

A New Website (again)

In the vein of the Dos Equis commercials: “I don’t always redo my website, but when I do, I go back and redo it again 5 months later.”

Five months ago, I switched over from a WordPress blog to a Ghost blog. At the time, it seemed like a good move, and I still am glad I did. I still believe that Node will be the new way to do websites, and everything I’m doing with software right now is in Node.

Recap: Why I switched

The main reason for me switching away from WordPress is simplicity. WordPress just has too much stuff that I’ll never use. This site is meant for me to catalog different experiences I have while working on hobbys and such. I didn’t need posts, pages, plugins, features, users, image gallerys, etc. Mostly I didn’t need the WYSIWYG editor that loved to make awful markup.

Then I found Ghost. I was drawn to it for the three reasons above: It is written in Node, the interface is simpler, and it uses Markdown, so the output is much better. It made writing posts easier, and the output had a nice, minimalistic feel to it.

Nothing is perfect

But soon, problems started to appear. The first (and biggest) problem is memory. This site is hosted on a VPS with 512mb RAM, and while thats enough for a normal website, I was trying to get the most out of it. Ghost tended to use around 90mb of memory, which seemed like a lot compared to all my other apps I was running.

Also, the editor was great, but I couldn’t make sense of the theme files, and the default theme on install was downloading jQuery. I wanted to get rid of it, but didn’t know if it would break anything.

The main reason I switched from WordPress to Ghost was because WordPress was too much. It had so many things I didn’t use, it was bulky and slow. After using Ghost for a while, I’ve found the same to be true. Ghost offers too much. I just wanted a simple system to publish pages and posts easily, and have a site that stayed up-to-date with latest web trends and standards.

Introducing Jekyll

I kept on hearing about Jekyll, through articles and IRC, and decided to give it a shot. It’s a static templating system, which means there is no CMS or database being used, the output is simply HTML files. Like Ghost, posts and pages can be written in Markdown or plain HTML, and Jekyll will parse them accordingly. The templates go in a _layouts folder, and Jekyll learns which templates to apply to which files through something called front matter. Front matter is a fancy word for a section of YAML at the beginning of each post. (If you aren’t familiar with YAML, it rhymes with camel, and YAML is to Ruby what JSON is to JavaScript). The front matter is where templates and other variables are defined.

Another plus about Jekyll is how small the files are. My entire site, source files and all, comes in at a little under 200kb (not including .git/ and node_modules/), which makes version control really easy to work with. You can check out this site on GitHub and if you see an error or want to change something, please file an issue there. If you’re feeling really helpful or adventurous, feel free to fork and submit a PR.

Server cleanup

I also took the time to do a little server maintenance, since a few things have changed in 5 months. I switched my server from Debian Sid to Ubuntu 14.04, to mirror what my testing servers and my standard Vagrant environment run. (And no, I don’t think running Sid on a server is crazy or insane, despite what some people have told me. As long as you are careful with updates everything will be fine). Creating a new DO server allowed me to get an IPv6 address, so this site is now fully IPv6 ready.

Other cool stuff

One of the benefts of having control of everything from the OS to the HTML is that I can customize and tweak almost anything I want. Some of this stuff I will go deeper in a future blog post, but general overview is HTTPS and IPv6 for everything, a ton of ip(6)tables rules (and more coming), nginx for all web serving, and no databases.

So here it is, my new site. I’ll hopefully stick with this longer than 5 months, but I’ve said that before…