This blog goes static

After a bit more than 9 years, I am replacing Serendipity, which as been hosting my blog, by a self-made static solution. This means that when you are reading this, my server no longer has to execute some rather large body of untyped code to produce the bytes sent to you. Instead, that happens once in a while on my laptop, and they are stored as static files on the server.

I hope to get a little performance boost from this, so that my site can more easily hold up to being mentioned on hackernews. I also do not want to worry about security issues in Serendipity – static files are not hacked.

Of course there are down-sides to having a static blog. The editing is a bit more annoying: I need to use my laptop (previously I could post from anywhere) and I edit text files instead of using a JavaScript-based WYSIWYG editor (but I was slightly annoyed by that as well). But most importantly your readers cannot comment on static pages. There are cloud-based solutions that integrate commenting via JavaScript on your static pages, but I decided to go for something even more low-level: You can comment by writing an e-mail to me, and I’ll put your comment on the page. This has the nice benefit of solving the blog comment spam problem.

The actual implementation of the blog is rather masochistic, as my web page runs on one of these weird obfuscated languages (XSLT). Previously, it contained of XSLT stylesheets producing makefiles calling XSLT sheets. Now it is a bit more-self-contained, with one XSLT stylesheet writing out all the various html and rss files.

I managed to import all my old posts and comments thanks to this script by Michael Hamann (I had played around with this some months ago and just spend what seemed to be an hour to me to find this script again) and a small Haskell script. Old URLs are rewritten (using mod_rewrite) to the new paths, but feed readers might still be confused by this.

This opens the door to a long due re-design of my webpage. But not today...


Thanks for going static. I really like, that comments are using via e-mail. How do you process those comments? Do you have a hook in your mail user agent to open your editor and work on the comment directly?
#1 anonymous am 2014-08-24T01:38:21-07:00
I don’t get that many comments. So for now, I manually copy’n’paste the comments to the respective XML file – this file in your case. But at least for the conversion of the date format, I guess I need some help... For now date --iso=seconds -d 'Sun, 24 Aug 2014 10:38:21 +0200' does the job.
#2 Joachim am 2014-08-24T08:57:56-07:00
#3 Thomas Koch am 2014-08-24T02:58:03-07:00
Thanks! Another advantage of this kind of commenting is that I can fix typos in comments :-)
I have a handy CGI-to-Mail script lying around for other sites anyways, which uses Template Toolkit. I guess I might use that. We’ll see. As I said, I don’t get many comments anyways :-)
#4 Joachim am 2014-08-24T09:02:00-07:00
Nicely done! I too have a small static site and this way of handling comments seems really reasonable.
My eyes caught "self-made static solution", I am really curious: what tools are you using? How do you write your posts (markdown)? What made you choose to write your own code rather than other solutions (Hakyll, etc.)?
#5 Francesco Ariis am 2014-08-24T10:14:46-07:00
I write my whole webpage, and now also my blog, in XML files in a custom XML dialect (although for the blog posts, in order to import them from Serendipity, I now also include plain HTML in these files). A Makefile and a set of XSLT files transform them to the desired output.
Part of the reason for this set up is historical: I have these XSL styles around since many years (probably since 2004). Originally, they were applied server-side, using AxKit, but I moved that to client-side application in 2006.
I considered trying to use Hakyll or the like, but I believe that they would not allow me to do everything I need. In particular, I want my markup to be at least partially semantic, e.g. for my project I want to have a tag <debian-bin pkg="arbtt"/> and have the stylesheet produce the right output.
I guess I could implement the whole thing in Haskell, and probably would do so if I’d start from scratch...
I plan to integrate markdown somehow in the process, at least for writing my blog posts, but that’s still on the TODO list.
#6 Joachim am 2014-08-24T11:25:27-07:00
I like the idea of static blogs, but loosing comments is an annoying side-effect of that. As you notice, there are some external solutions that imply delegating the comment hosting to a subcontractor, but I think there are also some alternative solutions that are self-hostable: that implies setting up a dynamic virtual host for hosting comments, but it may still be more efficient that using a fully dynamic blog.
Also, I have seen one example of someone using email for comments, but in an automated way, which means messages received at a specific address, or with a specific subject, are automatically processed and added as comments. That solution also has the nice property of being able to use an email antispam solution to filter comments.
#7 Tanguy Ortolo am 2014-08-25T02:33:43-07:00

Have something to say? You can post a comment by sending an e-Mail to me at <mail@joachim-breitner.de>, and I will include it here.