After many false-starts, my blog has finally been published! This will serve as a place for me to talk about what I have learned to remind myself/help others. Until now, I had looked at several blogging platforms and was continually disappointed by something or another:
- self-hosted - I want to own my data as much as possible
- multi-language - I would like to improve my Japanese writing ability
- continuous - essentialy, make a new file
git-pushand its done, no need for anything more complicated
want, but not needed:
- analytics (access count, unique users)
- feedback (NOT comments)
First up was Metalsmith and after a decent amount of fiddling with things, most of everything on the wishlist was covered. Except multi-lang. There’s a plugin, but was an extremely frustrating experience.
Next attempt was Vuepress, which is a wonderful framework that supports i18n out of the box and can publish easily to a variety of hosts. But the framework is still in a lot of flux. I may look at it again in the future as Vue’s component-based model is excellent.
Finally, I settled on Hugo as I can integrate with CICD, deploy anywhere and create truly multi-lang static sites with tags as well as an rss feed! Additionaly, themes are added as git submodules.
NOTE: The below architecture taught me alot about AWS, but I moved to Netlify!
CICD now looks like:
Git Push/Create PR => Netlify builds via hugo => Netlify deploys the site => DONE!
This is great because they also support SSL via Let’s Encrypt for free. It also only took 10min to migrate.
A tour of this blog (from post to deployment):
This makes use of three services: - GitHub.com (source host/workflow management) - Azure DevOps (CICD) - AWS (Hosting Platform)
The general flow looks like the below diagram (thanks to draw.io):
The source is saved on GitHub.com in a private repository. This makes for collaboration (TODO) and proof-reading much easier. For every post a new branch is made (e.g.
posts/my-blog-tour) locally. Using Hugo, a new article is made with the command
hugo new posts/my-blog-tour.md. This has the advantage of automatically creating the front-matter template. After writing and making a Japanese copy, the changes are pushed to GitHub. From here I create a PR, and assign reviewers. After revisions are completed, The PR is merged to the master branch. Any changes to the master branch will trigger a build and deployment by Azure DevOps. The CICD process is roughly:
- clone repository from GitHub
- clone submodules—for out theme
- download and extract Hugo
- use Hugo to build the site with the destination being the artifacts directory
- copy files from artifacts
- upload to AWS S3.
That is the tour for now, I would like to be able to support feedback (NOT comments) via github issues to make corrections and updates easier for everyone (I presonally dislike sites that have outdated information that become misleading lies given enough time). So if there is something in this blog that is incorrect/outdated or just weird, create an issue (there will be a link at the bottom of each page soon-ish) and let’s improve it.