Blog as Code

Blog as Code

workflow

Initially, I used Google Sites. It was not nice but ... Okay. Then Google completely remade the Sites. I had to migrate my content to the new version of the product. Things was not smooth: formats were broken, especially code format; the navigation experience was ugly...

I realized I was locked by a vendor in my own content. I was just thinking: it's a pity that a software engineer couldn't make a website for himself which is considered trivial in his job. I started finding way to make my own site by ... buying a domain name! I am happy that I finally could find a name that perfectly matches my philosophy.

Personally, I think a database for storing static text content is overkill. Imaging that I'll have to operate CMS server, a database server, and have to manage database backup/restore. Thus, I looked for a CMS that doesn't use database! It has to be open source and the programming language doens't matter.

I love Markdown especially how easy it is when taking note source code. For writing software-related topics, that is all we need. Hence, markdown support was added to the criteria.

I finally came to Grav, satisfying all my needs: a file-base open source CMS supporting Markdown syntax.

Here are steps showing how I adopted this CMS:

  • Started Grav with Docker locally.
  • Selected a theme, customized it a bit.
  • Put content which is just files and folders into the docker image. This is the wining point: everything is in the Docker image which I can deploy wherever I want.
  • Chose a Container-as-a-Service provider to host my Grav container. I started with Arukas and then switched to Hekoru, both with free plan.
  • Put Cloudflare in front of the web site using the free plan.
  • Pushed my content files to Bitbucket. Again, free plan.
  • Created a pipeline build in Bitbucket that allows automatically deploying my stuffs to Heroku right after I push them. Thus, contentious delivery!