zia TOC test

2003-04-11

This time, I put it in ~/.bzero/zia/site/TOC_test.txt and now it really ought to render the thing.
I still want to make a Table Of Contents (TOC) for this weblog, but work has gone nuts (yep, I'm still at the office at 11:30pm tonight) so I haven't gotten the chance to Do It Right, yet. For now, I just put a small logging function into the weblog's main template (index.py), like so:

logger_fn = "C:/my/log/file/name.txt"
flogger = None
def logRenders ( post ):
    # Log all of the rendering calls. Somewhat slow.
    global flogger
    if flogger is None:
        flogger = open( logger_fn, 'a' ) # Write, Append
    print >>flogger, ' URL(%s), TITLE(%s)' % ( post.GetUrl(), post["title"] )

I added a call to it from the RenderSinglePost function, as in "logRenders( post )". Then I cleared out my whole "rendered" directory ("~/.bzero/zia/rendered/**"), and did a "bzero zia render" command. Whammo, re-rendered every post, and left me a messy log file. Then I cleaned it up with Emacs. Like so: