Gone Serverless
Photo by Luca Bravo on Unsplash
I Want Simplicity
Don’t you like writing themes, maintain a CMS and also making sure you database is working? How about those constant patches you have to do to ensure that security is up to par? I hate all of those things! I just wanted to write tech based articles without having to worry about the security of my user name, various passwords, the database or the endless patches for exploits that were discovered in a number of open source CMS systems.
I have used Wordpress, Joomla and a number of other popular packages but it always seemed there was something getting in the way when it came to writing. There was something there just blocking me from writing when I felt inspired. More often than not, I was searching for the next add-on or plugin to enhance the experience but that just seemed to start bogging down the load times of the pages. This is when I decided to start thinking of a new project to take on and ditch the clunky CMS platforms for something that would allow me to write the way I wanted and also have faster performance for the user experience.
Hugo
This is when I stumbled upon Hugo which is a static site generator. It allows me to create a template and then feed my data into it to create static pages of my content. The content is rather simple as it’s written in Markdown and the templates are in HTML and JavaScript as required.
If you’re interested in how this page was written, here’s some of the markdown:
|
|
Now that I was able to get all my content into a format that I liked and could quickly write my posts without distractions, there was still the matter of how to host the site. I didn’t want to setup a dedicated server for something as simple as this nor did I want to have to manage a virtual environment.
Github Pages
I thought I could host this on a shared platform but that also brought to mind security issues that could occur. I wasn’t using a database and I didn’t need a really powerful system to present the pages. This led me to using Github Pages which grabs the files from the Git repo and then presents them as static pages after Hugo is done processing all the required files.
Publishing Workflow
Since I only have to push my content to one repo and have the Github’s infrastructure do all the heavy lifting, I can simply focus on my writing and coding projects. Since the pages I am serving are all static and rarely change, they’re normally stay cached on your local machine. This makes it easier to use as I don’t have worry about the admin section becoming compromised as there isn’t one since all files are just markdown files.
To help make the serving of the site faster, I have taken the image files and converted them to webp so that they are more portable for both desktop and mobile devices.