Under the hood

Updated: 2020-05-10

Here are some stories and implementation details about this website. Hopefully this can be helpful for the like-minded.

Note-taking, evolved (a little bit history)

Back in school, I hate taking notes using the physical notebooks, because half of the content may gradually become outdated, the other half should be expanded but it is hard to copy-and-paste. The end result is - I almost never ever read them again.

Then came Microsoft Word, copy-and-paste was no longer a problem, but I found it painful to do the formatting manually. ASCII arts looked much better than inconsistently formatted word documents to me.

Soon we were required to use LaTeX for assignments, I loved the fact that everything was written in plain text, and formatting was done automatically after compilation. However it can be an overkill if you are not dealing with math.

Another problem about LaTeX was that my notes were compiled into a pdf sitting on my local disk, it was hard to share on the web. Some of the computer science (except for math) related notes were migrated to Sphinx, the Python doc tool using reStructuredText as markup language.

I tried WordPress, but quickly gave up: (1) I did not want to manage my own server and database (2) it was not plain text (3) not a big fun of PHP.

I stumbled upon Nanoc when I was trying to setup a simple website for a side project, it was the first static site generator I used, and I immediately fell in love with in, because I write plain-text markdown files, and define formats and styles in CSS, and the website was pre-generated so extremely low maintenance. Until I needed to add some customization, I realized I need to learn Ruby. I have nothing against Ruby but based on my observation of the tech world trends, I did not have a good reason to spend time on it (I'm glad I did not). Jekyll is another Ruby based tool used by GitHub.

At the time I was learning Node for fun so I looked for something in Javascript. Ghost was the one I tried next, however similar to WordPress, I still need to maintain my server, after several outages I decided to move on.

After that I settled down with Hexo for a while. Like Nanoc it was a static site generator using Markdown, but in Javascript so I felt more comfortable to read the source code and make customizations when needed. The site was served on S3, cheap and low maintenance, nothing to complain.

For a brief time I used Gitbook, but later it pivoted to be a content publish platform instead of the awesome open-source tools, so I abandoned the ship.

Eventually I migrated to Gatsby, because of React and GraphQL. And below is an anatomy of the current tech stack.