About Archive Tags RSS Feed

 

Make anyone cry today?

23 March 2008 21:50

I've spent a lot of hours over the weekend stripping out markup on my personal website, so that I can regenerate it from a templating system.

My template-compiler is horribly hacky, but it produces reasonably good results from simple input files. The only motivation for this was to finally transition my site to a consistant layout, and allow me to easily change the layout again in the future.

I looked over WML, htmlpp, and a few other static web-compilers before writing my own tiny processor. I guess most of them are more powerful than mine, but similarly more complex to get started with.

I'll share the code if there is any interest. (Primarily it is template expansion of a body, optional per-page menus, and per-page HTML header inclusion.)

The only significant thing that has changed in my website is a tiny RSS feed of updates (also compiled!) and the removal of many sections from the top-level menu. (For example my body piercing section has been obsolete for years. It is still present, but I see no point in advertising it. Better resources exist..

The plus side is that I've managed to do all this whilst watching "Dead Like Me" over the Easter weekend. Both series from start to finish. Good show..

Obquote: 10 Things I Hate About You

| 4 comments

 

Comments on this entry

icon Gary Kramlich at 01:07 on 24 March 2008

What do you need in terms of templating? I started a template engine a while back because I couldn't find one that was GPL compatible, callable from C, and implemented for loops.

It's still far from stable, but you might want to check it out. http://misc.guifications.org/trac/wiki/gplate/. Right now it's just the library, but you could probably easily write a wrapper around it. It doesn't have a whole lot of functionality, but include and variable substitution sound like they might be enough. Note for loops are also working right now.

At any rate, if you check it out let me know, always looking for suggestions ;)

icon Steve at 09:25 on 24 March 2008

I want only the most basic of basic features:

  • Insert a "body" into a "template".
  • Variable expansion for "page title", etc.
  • Optional file inclusion.

I'm using the Perl module HTML::Template, so I could have loops if I needed them ..

icon pabs at 13:14 on 24 March 2008
Tried ikiwiki?
icon Steve at 13:41 on 24 March 2008

Not something I can use; given that my site is a collection of static and dynamic pages, some of which are generated by offsite tools and uploaded via rsync.