Why build a blog? #
Nowadays we have numerous ways of publishing our ideas, be it on Medium, Twitter/X, Instagram, etc. This democratization is great but personally I prefer to have control over what I publish and how it’s published.
As this article greatly explains, platforms can cease to exist someday, like MySpace or Orkut (for my Brazilian folks) once were the biggest social medias and now are like forgotten relics.
For this reason I decided to create a simple blog to post about things that I like while having full control on where and how I store those posts. Beyond that, I thought it would be a cool little project 🙂.
Pre-requisites #
Bellow are some pre-requisites that guided my choice of stack for building this blog, using the reasons explored above as a basis:
Support for plain text files #
In order to store the posts I decided to use text files, since they will be the easiest to port to any platform if needed. This means that whatever stack that I choose should translate easily these files to HTML pages.
Easy to setup initially #
It’s not easy to implement from scratch this translation from plain text files to HTML. Beyond that, I’m not exactly good at designing pages 👀.
For these reasons the stack should provide an easy initial configuration to get up and running as quickly as possible.
Flexibility to extend #
Even though I want an easy initial setup it’s important that the stack offer ways to customize the blog as needed to reflect changes that I may want to do in the future.
Building blocks #
With the requisites in mind I decided on the following building blocks to create the blog:
Hugo #
Hugo is a static site generator framework built with Go focused on speed and flexibility.
It uses templates to organize content and resources into static HTML pages. The content can be written in multiple plain text formats, but for this blog I’m using Markdown for its flexibility to work on multiple platforms and accessibility to be read by its own.
Blowfish #
Blowfish is a Hugo theme that offers pre-made templates that are very flexible, having lots of configurations available and even allowing to fully customize pages with custom layouts.
Github #
I use Github to store everything related to the project, from the content written on Markdown to the code necessary for Hugo.
Cloudflare Pages #
Cloudflare Pages is used to serve the static pages.
Another offering that I considered was Github Pages, but since I was already using Cloudflare to manage the blog domain it made the most sense to continue on the same ecosystem.
One advantage of using this approach is that I can leave the repository as private, which is good to upload posts that are still in draft to the repo.
How everything works together #
Putting the stack above to work looks something like this:
- Write the post in an markdown file, using Hugo to live check how it looks as a HTML page;
- Open a PR and check the preview deployment from Cloud Flare Pages;
- If everything works as expected, merge the changes to the main branch which will automatically trigger the blog deployment;