Why I decided to migrate from a Content Management System to a HUGO-powered static site
Jul 28, 2017 · 3 minute read · 473 words · Commentswebhugo
Back in 2012 I started blogging at lcdev.dk. At that time I decided to go with one of the popular PHP/MySQL based blogging platforms / Content Management Systems (CMS). It came with lots of integrated features making it simple to get started. However, as time has passed, I have never really used many of these features, and I have realized that, when it comes to blogging, being able to easily author, track, and publish content are the most important things for me.
During my study at the university, more or less everything was written in LaTeX. Initially, LaTeX seemed a bit overwhelming (lots of stuff to configure), but after playing around with it, the idea of separating content and layout just made more and more sense. This kind of decoupling made it so much more efficient to focus on writing content, while not having to worry about breaking the document’s layout. Further, tracking of content got trivial as well, since logical parts of the publication could be divided into multiple .tex
files.
If I could just get that in a blogging engine, that would make everything easier. This is where HUGO comes in. HUGO is a static site generator (SSG), that (similar to other SSGs) produces a static website from a set of files describing, e.g., the content and layout of your site. With an SSG, I get a clear separation between content and layout - similar to what I got with LaTeX. Yes, there are some configuration work to do initially, but with that done, writing new content is a breeze. I chose HUGO as my SSG because it runs smoothly on Windows 10 x64, is simple to setup, and compiles the site lightning fast ⚡️ (both for production and in watch mode).
Knowing that an SSG provides the features I am looking for, I have therefore decided to move my blogging activities to this new all-static website, powered by the HUGO SSG and a fork of the Hyde-X theme. The blog is hosted on Amazon AWS S3 with a CloudFront distribution in front. Over the coming weeks I will continue migrating my old blog at lcdev.dk to this new blog at blog.lcdev.io.
Boiled down, some of the advantages I find from migrating to a static site, are:
Decoupling
Content and layout are clearly decoupled. Makes it easy to focus on producing content knowing that layout is already configured elsewhere.
Faster
Static content is now served directly from the nearest CloudFront edge location and is simple to cache. Before, content was generated server side.
Safer
A static site is, well, static. No SQL injection risks, no regular patching of the CMS, etc. It’s just plain simple HTML/CSS/JS content.
Source Control
Having my blog in a source control system makes it easy to track changes and deploy only the files that have changed.