#!/usr/bin/env python # encoding: utf-8 import re # where to find the blog posts kBlogDir = "../blog" # the path which other urls are relative to kBlogPathBase = "/~rbetts/blog/" # name of stylesheet kBlogStyles = "doghouse.css" # the file suffix of blog posts kBlogPostSuffix = ".txt" # the title of the blog kBlogTitle = "Dog Named Banjo" # the maximum number of posts to show. kBlogMaxPosts = 5 # the index file name kBlogIndex = "index.idx" # the header template - printed first for each page kBlogHeaderTemplate = \ """Content-Type: text/html Ryan's Homepage
%(request)s
""" # the footer template - printed last for each page kBlogFooterTemplate = \ """

%(title)s

Cateogry: %(category)s
Date: %(date)s
%(content)s
""" def isHeader(line): """Return true if the line is a valid blogpost header.""" if (not line) or (line == "\n") or (line.rfind(':') == -1) : return 0 return 1 def makeTitleLink(title): """remove all dashes and make words underscore separated""" dashtmp = title.replace('-',' ') dashtmp = re.sub('\s+','_', dashtmp) return dashtmp def makeAbsolute(aString): return kBlogPathBase + aString