04 May 2005
| |||||||||||||||||||||||||||||||||||||||||||||||||
|
/ (38) code/ (1) emacs/ (2) go/ (1) hardware/ (2) python/ (2) spam/ (1) twisted/ (8) web/ (1) weblog/ (5) | |||||||||||||||||||||||||||||||||||||||||||||||||
#! /usr/bin/python
import sys
template = \
"""<html>
<head><title>$blog_title_with_path</title>
<meta name="robots" content="follow,noindex" />
</head>
<body><h1>$blog_title</h1><p>$pi_da $pi_mo $pi_yr</p>
"""
def cb_head(args):
"""This replaces the HEAD portion of the template whenever a 'directory'
is being rendered. The modified template adds special 'noindex' meta tags
to tell google that it shouldn't bother indexing the main page (since it
will change), but to index the permalink pages instead.
"""
#print >>sys.stderr, args['template']
if args['request'].getData()['bl_type'] == "dir":
args['template'] = template
return args
</pre>