Previously

The last iteration of my blog has not recieved any love for over two years. It was my fourth home-grown blog engine(githbub link), based on a Flask on Google App Engine project I did almost half a decade ago.

I have long come to the realization that I won’t be writing in any frequent fashion; any time I start a new blog it’s more for the fun factor of building the site itself - and nothing probably will be different this time around. However, I’d like to think after this one, I won’t be writing a blogging site for myself for a long time.

What changed?

Three things: hosting, work flow and design.

Hosting

Google App Engine is fantastic, I still have a number of small personal sites there among which read.yiransheng.com is the one I use the most. GAE as a managed service certainly makes a truly hassle free hosting solution for micro projects like a personal blog. In fact, I am still happy and satisfied about my old blog in every feature I managed to pack into it:

  • Syntax highlighting for code blocks
  • MathJax for LaTex formulas
  • Hyphenation
  • Markdown based authoring

Despite these, the three main reason I decided to move off GAE are strong enough to motivate this migration:

  • I don’t like writing in browser
  • I want to have my articles to be version controlled
  • I want to go full static and remove all usage of javaScript

So yeah, github pages is a better solution.

Work Flow

I knew I want to use markdown, and have the freedom to choose whatever text editor whenever. However, some things remain painful when authoring with markdown: making tables and plots. Over time I have grown to like two “markdown enhanced” workflow to address tables and visualizations, Rmarkdown and Jupyter. Having access to the full power of ggplot2 or matplotlib in a notebook environment, as well turning data.frame into markdown table source programmable improves the work flow tremendously, not to mention the benefits of not needing to context switch between coding and writing.

This post itself is written in Rmarkdown, of course. I have hacked together enough glue scripts for some post processing of Rmarkdown rendered html, and will gladly declare the new system functional, and will move on to handle Jupyter notebooks the next chance I get.

Design

Put it simply, default Rmarkdown html output is not appealing enough. The post processing step here does the following:

  • “Server” side rendering of LaTex formula using MathJax
  • “Server” side syntax highlighting for code blocks using pygments
  • Remove all Rmarkdown js and css
  • Inject CSS links to html DOM for a better looking theme and sharing assets across the site (Rmarkdown html is self-contained and inlines js, css, plots as base64 strings)
  • Some light DOM transformation related to presentation but not content

The final outcome? It turns this into this.

Closing Words

The processing steps are done in node, gulp and a few lines of python. I may write it up some time - as the exercise itself involved some fun experimenting with continuation passing style; but this post is long enough for coming out of a two year hiatus. Before ending it though, I’d like to note a single most important takeway of this project (which I sloppily forgot to address):

This site does not run any javaScript in your browser. Not bloats, no flickering of client-side rendering, no tracking.