I wanted to write a blog for when I find useful or interesting things, mainly when programming. Not only will I have an easy way of looking them up, they might also be useful to someone that stumbles upon this blog. This blogpost here was a great help, and the the OPIG Blog inspired me to get started with blogging.
To reduce the barrier of entry for writing a post, I wanted to be able to write in pure markdown. While there are multple ways to convert markdown to html, pandoc
seems to be the most powerful and versatile. It might also be interesting to use pandoc
to convert a draft of some sort to pdf via LaTeX, which pandoc
is also capable of.
The installation for windows is apparently not straightforward (I want to write on my surface), but installing pandoc on WSL is very easy.
While it is possible to add header-info (like a favicon, keywords and the pagetitle) within markodown in a yaml-block, I chose to write a short python program, that will take the necessary keywords from a comment at the top and thus keep the markdown-file itself as pure as possible.
Using a template from HTML5 UP!, I created a personal website (following the steps outlined in the blog post mentioned above).
With the template.md
file I adjusted the CSS from the template (adding code-highlighting, ...). I then added a link to the blog via a page blog/index.html
, where I will (have to manually) add the blog entries, as I write them. The complete workflow for creating a blogpost is as follows:
- Copy the
template.md
file. - Rename it with a shorttitle. (This will be displayed in the browser.)
- Write the blogpost, add keywords and the correct date.
- Switching to WSL, run
python _md_to_html.py <blogpost>.md
from theblog
folder. - Edit the
blog/index.md
and runpython _md_to_html.py index.md
- Add/commit/push the new/changed files (from Windows, WSL sees a lot of files as changed).