Art & Technology    [ BLOG ]

Table of Contents

Workflow for This Blog
Date created: January 30th, 2021

This entry is to document my effort in trying to create a blog without any popular content management systems (CMS) like Wordpress to have maximum flexibility in the design and layout of my website. My goal was to edit plain text files on my local computer and from the comfort of my own text editing tools. I will go over the workflow that I have developed to make writing blog entries as smooth and easy as possible, from Markdown to HTML to a published website.


I used Pandoc to compile Markdown files to HTML using one shell command. A simple command to do this conversion would be:

$ pandoc -f markdown -t html

-f/--from is a flag that specifies what file type we are starting from, and -t/--to is the file type we are converting to. is the file we want to convert. This will not overwrite the file, rather it will simply create a new file in the same directory called markdownfile.html.

A shorter way of doing the same thing is with the -o flag:

$ pandoc -o outputfile.html

-o/--output specifies the output file. In this example, we are specifying that we want to output to a file called outputfile.html using as the input. Pandoc is smart enough to look at the extensions of the input and output files to know what the --from and --to flags would be without manually entering them.

There are more flags and options, but I will only go over a few more in the following section. Visit the Pandoc User Manual for more information.


Writing a Makefile is very handy to apply the pandoc command to every Markdown file in a directory instead of doing it one at a time. A Makefile contains shell commands that can be executed upon running the Unix utility make. An advantage of using a Makefile is that it keeps track of changes so that it only applies the commands to the files we need.

Here is the file that I am currently using for this Blog site:

Now that we understand what Pandoc does, I can say that PANDOCFLAGSHTML is a variable containing all the flags that I am using with the pandoc command.

The complete command that I am using looks something like this:

$ pandoc markdownFile/ -o markdownFile/markdownFile.html --table-of-contents --toc-depth=4 --from=markdown+markdown_in_html_blocks+bracketed_spans --metadata-file=../pandoc/metadata.yaml --template=../pandoc/blog_template.html

Below is a simple html template. The $body$ variable will be replaced by the converted markdown content.

Here is a directory structure example:

├── index.html
├── Blog/
   ├─── Makefile
   ├─── blog_template.html
   ├─── Example_topic/
   #       Example_topic.html (generated after running make)

The rest would be to design the website style. I use UIkit as a front-end framework, highlight.js for code syntax highlighting, and Disqus for adding user comments. The site is hosted on Github Pages.


Here is a list of blogs that I have looked at and have been inspired by: