New Website... Again

20 March, 2017 • Viktor Bengtsson • 2 minutes to read

This started with a vacation, an urge to tinker, and an idea to visualize my reading progress online.

Last year I switched this website from Wordpress to the Jekyll static website generator. I also learned to code Python for a client project. I ended up building and deploying a Django framework webapp and so became quite comfortable with Python.

I've been very happy with Jekyll and with running a static website. It has done exactly what I need and no more. But I have felt a bit constrained in tinkering with and extending the functionality of Jekyll. I don't know Ruby, and having learnt one programming language last year was quite enough.

So I started looking around for the best way to integrate Python code on my Jekyll website and then I stumbled across Pelican.

Pelican is a simple static website generator written in Python. It uses the python markup library to parse markup to html and generates html with templates written in Jinja (which is very similar to Django's template language).

This was simply too good an opportunity, so I set about migrating from Jekyll to Pelican.

As my content was already in Markdown this was very simple, too simple to satisfy my urge to tinker. Luckily I wasn't happy with the template for my old site, and with Pelican's template language so similar to Django's, I set about building a template based on the Tufte css.

Tufte css worked pretty much out of the box for me. It is not written to support an entire website so I had to add some additional css to make my templates work the way I wanted. I also did some overrides on the tufte design logic where I felt that was needed.

The main issue was to find a simple way of generating the html patterns that tufte.css uses to produce side-notes, margin-notes etc. I ended up writing a small extension to the python markup library. I plan to release this on github as soon as I have tidied up the code. With this extension I can use simple Markup patterns to write Tufte-ready html.

So there you have it. The site is now fully migrated. My next project is to learn d3js to visualize my reading. It's horribly overkill I know, but I plan to use it in some bigger projects so this is a great opportunity to learn.