sixlegs.com / blog / java / homebrew-blogging-system.html

Root Beer Logo Root Beer

Chris Nokleberg's Fizzy Weblog

October 2005
Su M Tu W Th F Sa
            1
2 3 4 7 8
9 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
Previous  |  Next  |  More...
#  Homebrew blogging system

After a few years of using blojsom, I finally got around to writing my own blogging system, like everyone else (I guess it's the modern equivalent of a bug tracker).

But instead of a full-blown Java webapp, I went old-school. The code still pulls in plain HTML entries from the filesystem like blojsom/bloxsom. But then, after a bit of sorting, bucketing into categories, and whatnot, the entries get fed through a set of FreeMarker templates to produce static HTML pages. For some examples see the calendar, archives, and Atom 1.0 feed.

There were a bunch of reasons for going this route:

  • I had tweaked blojsom quite extensively: cleaner permalinks, FreeMarker-based templates, etc. Updating all my hacks as blojsom changed over the years was kind of a pain. In retrospect I'm very glad that I put some work into making blojsom permalinks look like normal files, because now they actually are normal files, and my permalinks still work. [Emoticon]
  • Blojsom's use of Velocity as the main templating engine makes the MVC separation uglier than it needs to be. For example, the special date formats used by the various feeds are calculated in Java code and stuck into the model. In FreeMarker you can just access the raw entry Date and use the ?string built-in to format the date however you want, directly from the template.
  • Blojsom was the only Java webapp running on my system. By eliminating it I could clean up a bunch of mod_proxy config mess. Also, since I hope to be Slashdotted at some point in the future, it seemed only prudent to make things as static as possible.

Re-generating and rsyncing the entire blog to my very remote server via Ant takes about 10 seconds, which is not much more time than reloading a webapp in Tomcat on my local machine. Really the only downside to running a static-only blog is that you of course lose the interactive bits: comments, trackbacks, searching, etc. Searching I'll leave to Google, and as for comments, well...send me an email.

[Powered By FreeMarker]  [Valid Atom 1.0]  [Weblog Commenting by HaloScan.com]