When you get down to it, Mephisto has all the things I want in a blog engine. Non-crufty permalinks. (Only Wordpress formats its permalinks similarly, although you can easily get this from Blosxom.) A clean interface (Simplelog is probably the only one that is as clean.) A templating system that doesn't utilize nested angle-brackets (something that every single templating system out there has a problem with, except for Liquid, XSLT, and Erubis.) A templating system that strives to separate business logic from presentation (this is something I hate about PHP, and it's the thing that drove me away from Wordpress and which keeps me away, despite the fact that it has been the easiest blog engine to deal with so far. This is the thing that I love about XSLT despite its obtuse, arcane syntax. This is what I fear about Erb, because it makes it so easy to insert Ruby into your templates, leading to the potential of a PHP-like mess. Granted, Ruby is a much cleaner language than PHP, but still.)
Unfortunately, to get the most out of Mephisto, you've got to be running trunk, and trunk requires Edge Rails. Not that this is immediately a fatal flaw, but for some reason, ever since trunk stopped working with Rails 1.2.3, I haven't been able to get Mephisto running stably. I keep getting that dreaded 500 error. It doesn't help that I'm running on shared hosting using Apache and Fast CGI. It doesn't help that it looks like Googlebot and Yahoo Slurp has been beating the crap out of my host.
Sometimes you've got to say enough is enough.
So Simplelog. It's fast. It's quick. Faster than Mephisto. Way faster than Typo, which is unfortunately extremely bloated. Simplelog looks pretty nice, too, what with the shading in the title bar that for some reason makes me think of an Apple Macintosh.
The down side. Little nitpicks, really. No dashes allowed in the tags. Underscores instead of dashes in the permalinks. (I'm pretty confident I can fix this with either .htaccess or config/routes.rb.) Crufty permalinks with past in it. (Again, .htaccess or config/routes.rb will likely save the day.) The template engine is Erb, which likes to utilize nested angle-brackets sometimes, and in which it can be tempting to throw in business logic. (Is it possible to use Erubis instead? Hmmm.)
Let's see how long I'll keep running this before jumping back to Mephisto.
(Actual tips and tricks on how to migrate to follow!)
So the experiment here is to see if I can just hack Blosxom and make it read XML files instead of the standard text files it reads.
I don’t want it to use folder-based categories, either, and would prefer to use tags, but I’m not entirely sure how that’s going to work. Hmmm. This could be the start of a beautiful disaster.
[meta commentary {2007.09.13}:]
[I have since once again abandoned this project. I don’t know why I’m so obsessed with the idea of launching my own blog engine when there are plenty of existing ones already. I just want to be able to control the syntax, I guess. This is one of the things that I like about Blosxom and Mephisto: you can essentially define your own XML tags and have the engine translate it into standard XHTML. So, for example, in Blosxom, I created my own pseudo-XML language that was supposed to mimic XSL. I also co-opted the <l> tag from the draft XHTML 2.0 spec, which I think is much better semantically than using <br/> tags when writing out song lyrics or displaying a poem. Plus it’s way less cumbersome than writing <span class=”line”>…</span> (which is what I had Blosxom translate it to anyway.) Mostly, these were shortcuts for otherwise lengthy pieces of HTML. For example, there is a plugin that implements the <blosxom:amazon-buybox> tag, which translates an ASIN into several lines of code. There are also shortcuts for including a link to a Google search page, and for including a link to the iTunes Music Store.]
[I didn’t play around with Mephisto’s text filters too much, but it wouldn’t be too hard to implement similar features. I admit, it’s all really syntactic sugar, and I don’t particularly miss them all that much, but still.]
[One of the features that I kind of liked from my hand-rolled static-page generating blog engine was the fact that you could abstract all the links from the entry and create a link log from them. I used a tag similar to <a>, except with a few extra attributes, like so:]
<bx:link href="http://somewhere.com" label="a website for the apathetic" desc="supposedly the epitome of an old-school E/N (everything and nothing) blog, only it doesn't really exist">Follow this link</bx:link>
[Actually, I was really using the blog namespace instead of bx, and dubbed my kludgery of XHTML as blogml. Unfortunately, blogml is actually already taken, but since I ended up abandoning my kludgery and utilizing Blosxom, I forgot about it for a while. Because of my strange fascination with XML tags, I used the blosxom namespace for all the shortcuts I created (hence, <blosxom:amazon-buybox>, <blosxom:itms-link>, etc., etc.) But typing out blosxom all the time is extremely cumbersome, so I ended up shortening it to bx.]
[After a while, I got the itch to write my own blog engine again, except this time it would generate dynamic pages. I thought that I would call it bx, since my first conception was literally a down and dirty (and incomplete) hack of the Blosxom code base. Bx is actually the abbreviation for biopsy, which I thought would make a good name for a blog engine. (In medicine, because most of the terms are Greek or Latin, and they tend to be painfully long, everything can be abbreviated by taking the first few letters and appending an “x” to it. So dx means diagnosis, tx means treatment, rx means prescription, cx means culture, etc. The Evil Resident actually has a list of the more common abbreviations that are found in medical documentation.)]
I seem to revisit this topic from time to time. Usually in the context of trying to struggling through someone else’s code.
Now, the standard disclaimer: I am not a programmer. Or, more accurately, I don’t write code for a living. (We are all programmers now, are we not?)
But I continue to struggle with the ‘right-thing’ vs ‘worse-is-better’ debate. On one hand is the fact that I learned how to code of textbooks, and the readability of code had high priority. Clean algorithms and appropriate commenting (enough, but not too much) naturally leads to readability (or so they say), and also make maintenance less of a chore.
On the other hand, no one likes vaporware, which is what following the ‘right-thing’ philosophy frequently leads to. Witness the GNU/Hurd, for example.
But the history of information technology has many examples of ‘the right-thing’ pitted against ‘worse-is-better’. Mac OS vs MS-DOS. Pre-emptive multitasking vs cooperative multitasking. RISC vs x86. HURD vs Linux. GNOME vs KDE. Lisp vs C. C vs Java. ObjC vs C++. The list goes on-and-on. If ‘worse-is-better’ wasn’t a winning ticket, Microsoft would’ve gone bankrupt decades ago.
Why do I wax philosophical?
I’ve stared at the monolith codebase known as Wordpress and have fled in fear and horror.
Oh, Wordpress works, all right. I’ve been running it for several iterations now, for well over a year. But all I wanted to do was write a simple custom theme.
Horror of horrors.
The thing that I like about my kludgy XSLT/Makefile/perl script homebrew, and what I liked about Blosxom (after you installed the ‘theme’ plug-in) was that it was trivial to convert an XHTML design into a blog template. Throw in a few conditional statements here, a few variables there, and voila, you’ve got yourself a theme.
Screwing around with Wordpress is a little more involved than that.
For one thing, the template is strewn across multiple files (which was something that I loathed about Blosxom without the ‘theme’ plug-in) Sure, at the bare minimum, you could get away with just style.css and index.php, but then it gets kind of ugly, and most sane people include header.php, sidebar.php, and footer.php as well. Not to mention comments.php. I’m sure there are a few more I’ve forgotten to mention, but I’d rather not wade through lines of PHP right now.
For another thing, I find PHP aesthetically displeasing. It can’t seem to decide whether it’s a templating language (like the Perl Template Toolkit, MASON, or XSLT) or if it’s a full on scripting language like Perl, Python, and Ruby. And the syntax shows it.
For some reason, I really detest nested angle-brackets. I can’t stand stuff like this: <a href="<?php echo $url ?>" title="<?php echo $desc ?>"><?php echo $link_text ?></a>. Call it a pet-peeve. Call it psychosis. Whatever. But this is common practice in PHP, and it makes me feel the same way that scratching fingernails across a chalkboard does.
But the scripting/templating schizophrenia makes reading code a chore, and it has taken me a good while to follow the logic of the templates themselves, much less actually understanding the functions I’m supposed to call.
Now the functions. Ugh. To be fair, Wordpress has existed in several incarnations, previously known as b2 which was released back in 2001. Since it’s debut as Wordpress in 2003, the code has gone through 2 major revisions and several minor revisions. The latest iteration is version 2.2. It’s extremely popular and many webhosts have it installed for your immediate use.
Digging into the code, you can almost see the different layers, kind of like an exercise in paleontology. Strata after strata of heaped-on code. Lots of inadvertant redundancy.
The thing that started driving me crazy was that there were functions that returned actual values, and functions that sent direct output. Some of them followed a certain convention. (If there was a function x() that displayed output, then usually there was a function get_x() that would return a value.) But God help you if the function you wanted didn’t follow that convention. Usually there is no recourse but to read the source code itself, which can get tedious, to say the least.
At first, I started mucking around with the template code just so I could understand the logic. For one thing, the way PHP can switch in and out of templating mode confused me (and, in all honesty, continues to confuse me, even though I know it really shouldn’t be that confusing.) For another thing, I wanted to see if I could get rid of the nasty nested angled brackets. I’m slowly finding out that this is almost, but not quite, feasible.
But before I realized the futility of separating code from presentation, I had this grand scheme of building a template engine, such that you only had to change one file to customize a template rather than screwing around with all these subfiles. One include and I could be home free and have customizability galore. But wp_query stopped me cold in my tracks. I would have to learn Wordpress’s object classes and methods. Shudder.
So on one hand, I could just give up and stick my HTML into the proper places in the template code, and give up on readability. As long as it works, what do I care, right? On the other hand, it’s clear that, short of complete rewriting the codebase (I never did like the reliance on a SQL database, and I might as well rewrite it in Perl or Ruby if I’m going to do something insane like that), I’m not going to find the Holy Grail of easy template editability. It may be time to move on to yet another blog engine. Or chase that unicorn of writing my own. Double-shudder.
