Contents

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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
title: "Gone Serverless"
date: 2022-05-09
lastmod: 2022-05-09
draft: false
author: "Lawrence"
authorLink: "https://lawrencestockman.com"
description: "I've gone serverless!"
resources:
  - name: "featured-image"
    src: "new_blog.webp"

tags: ["Serverless", "HTML", "JavaScript"]
categories: ["Serverless", "Static Site Generator"]

lightgallery: false

toc: false
---

## 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](https://gohugo.io)** which is a static site generator. It allows me to create a template and then feed my data into it to create....



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

/images/publishing_workflow.png

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.