The background
Static site generators (SSGs) are engines1 that use text input files to generate static web pages, these generated sites do not require a backend afterwards, making them primary entities on content delivery networks (CDNs). Further, since the lack of a backend, static site generators inherently have a reduced attack surface2, minimizing potential vulnerabilities.
I’ve been using Hugo3 since I started writing a tech blog, which has proved to be great on it’s own along with a cool ecosystem. My pleasant experience with Hugo led me to use it on other blogs as well, where I write about other subtle stuff that fits better on their own pages. In a previous post4, I’ve written about how GitHub Actions are used for building the Hugo blogs automatically triggered by a commit to the GH repository where the source resides. While the blog sites used to be hosted on GH pages, they have been moved on5 to Cloudflare Pages since.
The project
It’s been quite some time since I started a new project, and then I stumbled upon this submission6 on HN. This gave me an idea: let’s build an SSG. At first I was all excited and planned to write one in C++
, which would output static sites in record time. However, knowing about my attention spans from experience, I decided to use Python
which would probably make building the actual thing much faster for me, and then Pysen7 came to be. Most of it’s functionalities are already implemented, and more are yet to be implemented8. For the time being, the SSG is being “dogfooded”9 at one of my blogs10. Let’s see how things take shape as the days roll by—fast!
Wrote a new verse at https://hasithsen.pages.dev/verse/building-is-fun/ to celebrate building stuff, and yes, the last line is hinting at that quote in the awesome book Wind, Sand and Stars by Antoine de Saint Exupéry.
https://hasithsen.pages.dev/tech/posts/automate-deployment-hugo-github/ ↩︎
My student GH Pro membership ended, and GH Pages are only available in public repos for GH Free users. See https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages, and https://developers.cloudflare.com/pages/. ↩︎
https://news.ycombinator.com/item?id=38126210, shoutout to Arne Bahlo! ↩︎
Thanks much for the encouragement and excellent advice Chamara aiye! ↩︎