]> git.deb.at Git - pkg/blosxom.git/blob - blosxom.cgi
Add $blog_encoding back to default content_type flavours, and simple content_type...
[pkg/blosxom.git] / blosxom.cgi
1 #!/usr/bin/perl
2
3 # Blosxom
4 # Author: Rael Dornfest <rael@oreilly.com>
5 # Version: 2.0.2
6 # Home/Docs/Licensing: http://blosxom.sourceforge.net/
7 # Development/Downloads: http://sourceforge.net/projects/blosxom
8
9 package blosxom;
10
11 # --- Configurable variables -----
12
13 # What's this blog's title?
14 $blog_title = "My Weblog";
15
16 # What's this blog's description (for outgoing RSS feed)?
17 $blog_description = "Yet another Blosxom weblog.";
18
19 # What's this blog's primary language (for outgoing RSS feed)?
20 $blog_language = "en";
21
22 # What's this blog's text encoding ?
23 $blog_encoding = "UTF-8";
24
25 # Where are this blog's entries kept?
26 $datadir = "/Library/WebServer/Documents/blosxom";
27
28 # What's my preferred base URL for this blog (leave blank for automatic)?
29 $url = "";
30
31 # Should I stick only to the datadir for items or travel down the
32 # directory hierarchy looking for items?  If so, to what depth?
33 # 0 = infinite depth (aka grab everything), 1 = datadir only, n = n levels down
34 $depth = 0;
35
36 # How many entries should I show on the home page?
37 $num_entries = 40;
38
39 # What file extension signifies a blosxom entry?
40 $file_extension = "txt";
41
42 # What is the default flavour?
43 $default_flavour = "html";
44
45 # Should I show entries from the future (i.e. dated after now)?
46 $show_future_entries = 0;
47
48 # --- Plugins (Optional) -----
49
50 # File listing plugins blosxom should load 
51 # (if empty blosxom will load all plugins in $plugin_path directories)
52 $plugin_list = "";
53
54 # Where are my plugins kept? (list of directories, separated by ':')
55 $plugin_path = "";
56
57 # Where should my plugins keep their state information?
58 $plugin_state_dir = "";
59 #$plugin_state_dir = "/var/lib/blosxom/state";
60
61 # --- Static Rendering -----
62
63 # Where are this blog's static files to be created?
64 $static_dir = "/Library/WebServer/Documents/blog";
65
66 # What's my administrative password (you must set this for static rendering)?
67 $static_password = "";
68
69 # What flavours should I generate statically?
70 @static_flavours = qw/html rss/;
71
72 # Should I statically generate individual entries?
73 # 0 = no, 1 = yes
74 $static_entries = 0;
75
76 # --------------------------------
77
78 use vars qw! $version $blog_title $blog_description $blog_language $blog_encoding $datadir $url %template $template $depth $num_entries $file_extension $default_flavour $static_or_dynamic $config_dir $plugin_list $plugin_path $plugin_dir $plugin_state_dir @plugins %plugins $static_dir $static_password @static_flavours $static_entries $path_info $path_info_yr $path_info_mo $path_info_da $path_info_mo_num $flavour $static_or_dynamic %month2num @num2month $interpolate $entries $output $header $show_future_entries %files %indexes %others !;
79
80 use strict;
81 use FileHandle;
82 use File::Find;
83 use File::stat;
84 use Time::localtime;
85 use Time::Local;
86 use CGI qw/:standard :netscape/;
87
88 $version = "2.0.2";
89
90 # Load configuration from $ENV{BLOSXOM_CONFIG_DIR}/blosxom.conf, if it exists
91 my $blosxom_config;
92 if ($ENV{BLOSXOM_CONFIG_FILE} && -r $ENV{BLOSXOM_CONFIG_FILE}) {
93   $blosxom_config = $ENV{BLOSXOM_CONFIG_FILE};
94   ($config_dir = $blosxom_config) =~ s! / [^/]* $ !!x;                          
95 }
96 else {
97   for my $blosxom_config_dir ($ENV{BLOSXOM_CONFIG_DIR}, '/etc/blosxom', '/etc') {
98     if (-r "$blosxom_config_dir/blosxom.conf") {
99       $config_dir = $blosxom_config_dir;
100       $blosxom_config = "$blosxom_config_dir/blosxom.conf";
101       last;
102     }
103   }
104 }
105 # Load $blosxom_config
106 if ($blosxom_config) { 
107   if (-r $blosxom_config) {
108     eval { require $blosxom_config } or
109       warn "Error reading blosxom config file '$blosxom_config'" . ($@ ? ": $@" : '');
110   }
111   else {
112     warn "Cannot find or read blosxom config file '$blosxom_config'";
113   }
114 }
115
116 my $fh = new FileHandle;
117
118 %month2num = (nil=>'00', Jan=>'01', Feb=>'02', Mar=>'03', Apr=>'04', May=>'05', Jun=>'06', Jul=>'07', Aug=>'08', Sep=>'09', Oct=>'10', Nov=>'11', Dec=>'12');
119 @num2month = sort { $month2num{$a} <=> $month2num{$b} } keys %month2num;
120
121 # Use the stated preferred URL or figure it out automatically
122 $url ||= url(-path_info => 1);
123 $url =~ s/^included:/http:/ if $ENV{SERVER_PROTOCOL} eq 'INCLUDED';
124
125 # NOTE: Since v3.12, it looks as if CGI.pm misbehaves for SSIs and
126 # always appends path_info to the url. To fix this, we always
127 # request an url with path_info, and always remove it from the end of the
128 # string.
129 my $pi_len = length $ENV{PATH_INFO};
130 my $might_be_pi = substr($url, -$pi_len);
131 substr($url, -length $ENV{PATH_INFO}) = '' if $might_be_pi eq $ENV{PATH_INFO};
132
133 $url =~ s!/$!!;
134
135 # Drop ending any / from dir settings
136 $datadir =~ s!/$!!; $plugin_dir =~ s!/$!!; $static_dir =~ s!/$!!;
137   
138 # Fix depth to take into account datadir's path
139 $depth and $depth += ($datadir =~ tr[/][]) - 1;
140
141 # Global variable to be used in head/foot.{flavour} templates
142 $path_info = '';
143
144 $static_or_dynamic = (!$ENV{GATEWAY_INTERFACE} and param('-password') and $static_password and param('-password') eq $static_password) ? 'static' : 'dynamic';
145 $static_or_dynamic eq 'dynamic' and param(-name=>'-quiet', -value=>1);
146
147 # Path Info Magic
148 # Take a gander at HTTP's PATH_INFO for optional blog name, archive yr/mo/day
149 my @path_info = split m{/}, path_info() || param('path'); 
150 shift @path_info;
151
152 while ($path_info[0] and $path_info[0] =~ /^[a-zA-Z].*$/ and $path_info[0] !~ /(.*)\.(.*)/) { $path_info .= '/' . shift @path_info; }
153
154 # Flavour specified by ?flav={flav} or index.{flav}
155 $flavour = '';
156
157 if ( $path_info[$#path_info] =~ /(.+)\.(.+)$/ ) {
158   $flavour = $2;
159   $1 ne 'index' and $path_info .= "/$1.$2";
160   pop @path_info;
161 } else {
162   $flavour = param('flav') || $default_flavour;
163 }
164
165 # Strip spurious slashes
166 $path_info =~ s!(^/*)|(/*$)!!g;
167
168 # Date fiddling
169 ($path_info_yr,$path_info_mo,$path_info_da) = @path_info;
170 $path_info_mo_num = $path_info_mo ? ( $path_info_mo =~ /\d{2}/ ? $path_info_mo : ($month2num{ucfirst(lc $path_info_mo)} || undef) ) : undef;
171
172 # Define standard template subroutine, plugin-overridable at Plugins: Template
173 $template = 
174   sub {
175     my ($path, $chunk, $flavour) = @_;
176
177     do {
178       return join '', <$fh> if $fh->open("< $datadir/$path/$chunk.$flavour");
179     } while ($path =~ s/(\/*[^\/]*)$// and $1);
180
181     # Check for definedness, since flavour can be the empty string
182     if (defined $template{$flavour}{$chunk}) {
183         return $template{$flavour}{$chunk};
184     } elsif (defined $template{error}{$chunk}) {
185         return $template{error}{$chunk} 
186     } else {
187         return '';
188     }
189   };
190 # Bring in the templates
191 %template = ();
192 while (<DATA>) {
193   last if /^(__END__)$/;
194   my($ct, $comp, $txt) = /^(\S+)\s(\S+)(?:\s(.*))?$/ or next;
195   $txt =~ s/\\n/\n/mg;
196   $template{$ct}{$comp} .= $txt . "\n";
197 }
198
199 # Plugins: Start
200 my @plugin_dirs = split /:/, ($plugin_path || $plugin_dir);
201 my @plugin_list = ();
202 my %plugin_hash = ();
203
204 # If $plugin_list is set, read plugins to use from that file
205 $plugin_list = "$config_dir/$plugin_list"
206   if $plugin_list && $plugin_list !~ m!^\s*/!;
207 if ( $plugin_list and -r $plugin_list and $fh->open("< $plugin_list") ) {
208   @plugin_list = map { chomp $_; $_ } grep { /\S/ && ! /^#/ } <$fh>; 
209   $fh->close;
210 }
211 # Otherwise walk @plugin_dirs to get list of plugins to use
212 elsif ( @plugin_dirs ) {
213   for my $plugin_dir ( @plugin_dirs ) {
214     next unless -d $plugin_dir;
215     if ( opendir PLUGINS, $plugin_dir ) {
216       for my $plugin ( grep { /^[\w:]+$/ && ! /~$/ && -f "$plugin_dir/$_" } readdir(PLUGINS) ) {
217         # Ignore duplicates
218         next if $plugin_hash{ $plugin };
219         # Add to @plugin_list and %plugin_hash
220         $plugin_hash{ $plugin } = "$plugin_dir/$plugin";
221         push @plugin_list, $plugin;
222       }
223       closedir PLUGINS;
224     }
225   }
226   @plugin_list = sort @plugin_list;
227 }
228
229 # Load all plugins in @plugin_list
230 unshift @INC, @plugin_dirs;
231 foreach my $plugin ( @plugin_list ) {
232   my($plugin_name, $off) = $plugin =~ /^\d*([\w:]+?)(_?)$/;
233   my $on_off = $off eq '_' ? -1 : 1;
234   # Allow perl module plugins
235   if ($plugin =~ m/::/ && -z $plugin_hash{ $plugin }) {
236     # For Blosxom::Plugin::Foo style plugins, we need to use a string require
237     eval "require $plugin_name";
238   }
239   else {
240     eval { require $plugin };
241   }
242   $@ and warn "error finding or loading blosxom plugin $plugin_name - skipping\n" and next;
243   $plugin_name->start() and ( $plugins{$plugin_name} = $on_off ) and push @plugins, $plugin_name;
244 }
245 shift @INC foreach @plugin_dirs;
246
247 # Plugins: Template
248 # Allow for the first encountered plugin::template subroutine to override the
249 # default built-in template subroutine
250 my $tmp; foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('template') and defined($tmp = $plugin->template()) and $template = $tmp and last; }
251
252 # Provide backward compatibility for Blosxom < 2.0rc1 plug-ins
253 sub load_template {
254   return &$template(@_);
255 }
256
257 # Define default entries subroutine
258 $entries =
259   sub {
260     my(%files, %indexes, %others);
261     find(
262       sub {
263         my $d; 
264         my $curr_depth = $File::Find::dir =~ tr[/][]; 
265         return if $depth and $curr_depth > $depth; 
266      
267         if ( 
268           # a match
269           $File::Find::name =~ m!^$datadir/(?:(.*)/)?(.+)\.$file_extension$!
270           # not an index, .file, and is readable
271           and $2 ne 'index' and $2 !~ /^\./ and (-r $File::Find::name)
272         ) {
273
274             # to show or not to show future entries
275             ( 
276               $show_future_entries
277               or stat($File::Find::name)->mtime < time 
278             )
279
280               # add the file and its associated mtime to the list of files
281               and $files{$File::Find::name} = stat($File::Find::name)->mtime
282
283                 # static rendering bits
284                 and (
285                   param('-all') 
286                   or !-f "$static_dir/$1/index." . $static_flavours[0]
287                   or stat("$static_dir/$1/index." . $static_flavours[0])->mtime < stat($File::Find::name)->mtime
288                 )
289                   and $indexes{$1} = 1
290                     and $d = join('/', (nice_date($files{$File::Find::name}))[5,2,3])
291   
292                       and $indexes{$d} = $d
293                         and $static_entries and $indexes{ ($1 ? "$1/" : '') . "$2.$file_extension" } = 1
294
295             } 
296             else {
297               !-d $File::Find::name and -r $File::Find::name and $others{$File::Find::name} = stat($File::Find::name)->mtime
298             }
299       }, $datadir
300     );
301
302     return (\%files, \%indexes, \%others);
303   };
304
305 # Plugins: Entries
306 # Allow for the first encountered plugin::entries subroutine to override the
307 # default built-in entries subroutine
308 my $tmp; foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('entries') and defined($tmp = $plugin->entries()) and $entries = $tmp and last; }
309
310 my ($files, $indexes, $others) = &$entries();
311 %indexes = %$indexes;
312
313 # Static
314 if (!$ENV{GATEWAY_INTERFACE} and param('-password') and $static_password and param('-password') eq $static_password) {
315
316   param('-quiet') or print "Blosxom is generating static index pages...\n";
317
318   # Home Page and Directory Indexes
319   my %done;
320   foreach my $path ( sort keys %indexes) {
321     my $p = '';
322     foreach ( ('', split /\//, $path) ) {
323       $p .= "/$_";
324       $p =~ s!^/!!;
325       $done{$p}++ and next;
326       (-d "$static_dir/$p" or $p =~ /\.$file_extension$/) or mkdir "$static_dir/$p", 0755;
327       foreach $flavour ( @static_flavours ) {
328         my $content_type = (&$template($p,'content_type',$flavour));
329         $content_type =~ s!\n.*!!s;
330         my $fn = $p =~ m!^(.+)\.$file_extension$! ? $1 : "$p/index";
331         param('-quiet') or print "$fn.$flavour\n";
332         my $fh_w = new FileHandle "> $static_dir/$fn.$flavour" or die "Couldn't open $static_dir/$p for writing: $!";  
333         $output = '';
334         if ($indexes{$path} == 1) {
335           # category
336           $path_info = $p;
337           # individual story
338           $path_info =~ s!\.$file_extension$!\.$flavour!;
339           print $fh_w &generate('static', $path_info, '', $flavour, $content_type);
340         } else {
341           # date
342           local ($path_info_yr,$path_info_mo,$path_info_da, $path_info) = 
343               split /\//, $p, 4;
344           unless (defined $path_info) {$path_info = ""};
345           print $fh_w &generate('static', '', $p, $flavour, $content_type);
346         }
347         $fh_w->close;
348       }
349     }
350   }
351 }
352
353 # Dynamic
354 else {
355   my $content_type = (&$template($path_info,'content_type',$flavour));
356   $content_type =~ s!\n.*!!s;
357
358   $content_type =~ s/(\$\w+(?:::)?\w*)/"defined $1 ? $1 : ''"/gee;
359   $header = {-type=>$content_type};
360
361   print generate('dynamic', $path_info, "$path_info_yr/$path_info_mo_num/$path_info_da", $flavour, $content_type);
362 }
363
364 # Plugins: End
365 foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('end') and $entries = $plugin->end() }
366
367 # Generate 
368 sub generate {
369   my($static_or_dynamic, $currentdir, $date, $flavour, $content_type) = @_;
370
371   %files = %$files; %others = ref $others ? %$others : ();
372
373   # Plugins: Filter
374   foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('filter') and $entries = $plugin->filter(\%files, \%others) }
375
376   my %f = %files;
377
378   # Plugins: Skip
379   # Allow plugins to decide if we can cut short story generation
380   my $skip; foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('skip') and defined($tmp = $plugin->skip()) and $skip = $tmp and last; }
381   
382   # Define default interpolation subroutine
383   $interpolate = 
384     sub {
385       package blosxom;
386       my $template = shift;
387       $template =~ 
388         s/(\$\w+(?:::)?\w*)/"defined $1 ? $1 : ''"/gee;
389       return $template;
390     };  
391
392   unless (defined($skip) and $skip) {
393
394     # Plugins: Interpolate
395     # Allow for the first encountered plugin::interpolate subroutine to 
396     # override the default built-in interpolate subroutine
397     my $tmp; foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('interpolate') and defined($tmp = $plugin->interpolate()) and $interpolate = $tmp and last; }
398         
399     # Head
400     my $head = (&$template($currentdir,'head',$flavour));
401   
402     # Plugins: Head
403     foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('head') and $entries = $plugin->head($currentdir, \$head) }
404   
405     $head = &$interpolate($head);
406   
407     $output .= $head;
408     
409     # Stories
410     my $curdate = '';
411     my $ne = $num_entries;
412
413     if ( $currentdir =~ /(.*?)([^\/]+)\.(.+)$/ and $2 ne 'index' ) {
414       $currentdir = "$1$2.$file_extension";
415       $files{"$datadir/$1$2.$file_extension"} and %f = ( "$datadir/$1$2.$file_extension" => $files{"$datadir/$1$2.$file_extension"} );
416     } 
417     else { 
418       $currentdir =~ s!/index\..+$!!;
419     }
420
421     # Define a default sort subroutine
422     my $sort = sub {
423       my($files_ref) = @_;
424       return sort { $files_ref->{$b} <=> $files_ref->{$a} } keys %$files_ref;
425     };
426   
427     # Plugins: Sort
428     # Allow for the first encountered plugin::sort subroutine to override the
429     # default built-in sort subroutine
430     my $tmp; foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('sort') and defined($tmp = $plugin->sort()) and $sort = $tmp and last; }
431   
432     foreach my $path_file ( &$sort(\%f, \%others) ) {
433       last if $ne <= 0 && $date !~ /\d/;
434       use vars qw/ $path $fn /;
435       ($path,$fn) = $path_file =~ m!^$datadir/(?:(.*)/)?(.*)\.$file_extension!;
436   
437       # Only stories in the right hierarchy
438       $path =~ /^$currentdir/ or $path_file eq "$datadir/$currentdir" or next;
439   
440       # Prepend a slash for use in templates only if a path exists
441       $path &&= "/$path";
442
443       # Date fiddling for by-{year,month,day} archive views
444       use vars qw/ $dw $mo $mo_num $da $ti $yr $hr $min $hr12 $ampm $utc_offset/;
445       ($dw,$mo,$mo_num,$da,$ti,$yr,$utc_offset) = nice_date($files{"$path_file"});
446       ($hr,$min) = split /:/, $ti;
447       ($hr12, $ampm) = $hr >= 12 ? ($hr - 12,'pm') : ($hr, 'am'); 
448       $hr12 =~ s/^0//; $hr12 == 0 and $hr12 = 12;
449   
450       # Only stories from the right date
451       my($path_info_yr,$path_info_mo_num, $path_info_da) = split /\//, $date;
452       next if $path_info_yr && $yr != $path_info_yr; last if $path_info_yr && $yr < $path_info_yr; 
453       next if $path_info_mo_num && $mo ne $num2month[$path_info_mo_num];
454       next if $path_info_da && $da != $path_info_da; last if $path_info_da && $da < $path_info_da; 
455   
456       # Date 
457       my $date = (&$template($path,'date',$flavour));
458       
459       # Plugins: Date
460       foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('date') and $entries = $plugin->date($currentdir, \$date, $files{$path_file}, $dw,$mo,$mo_num,$da,$ti,$yr) }
461   
462       $date = &$interpolate($date);
463   
464       $curdate ne $date and $curdate = $date and $output .= $date;
465       
466       use vars qw/ $title $body $raw /;
467       if (-f "$path_file" && $fh->open("< $path_file")) {
468         chomp($title = <$fh>);
469         chomp($body = join '', <$fh>);
470         $fh->close;
471         $raw = "$title\n$body";
472       }
473       my $story = (&$template($path,'story',$flavour));
474   
475       # Plugins: Story
476       foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('story') and $entries = $plugin->story($path, $fn, \$story, \$title, \$body) }
477       
478       if ($content_type =~ m{\bxml\b}) {
479         # Escape <, >, and &, and to produce valid RSS
480         my %escape = ('<'=>'&lt;', '>'=>'&gt;', '&'=>'&amp;', '"'=>'&quot;');  
481         my $escape_re  = join '|' => keys %escape;
482         $title =~ s/($escape_re)/$escape{$1}/g;
483         $body =~ s/($escape_re)/$escape{$1}/g;
484       }
485   
486       $story = &$interpolate($story);
487     
488       $output .= $story;
489       $fh->close;
490   
491       $ne--;
492     }
493   
494     # Foot
495     my $foot = (&$template($currentdir,'foot',$flavour));
496   
497     # Plugins: Foot
498     foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('foot') and $entries = $plugin->foot($currentdir, \$foot) }
499   
500     $foot = &$interpolate($foot);
501     $output .= $foot;
502
503     # Plugins: Last
504     foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('last') and $entries = $plugin->last() }
505
506   } # End skip
507
508   # Finally, add the header, if any and running dynamically
509   $static_or_dynamic eq 'dynamic' and $header and $output = header($header) . $output;
510   
511   $output;
512 }
513
514
515 sub nice_date {
516   my($unixtime) = @_;
517   
518   my $c_time = ctime($unixtime);
519   my($dw,$mo,$da,$hr,$min,$yr) = ( $c_time =~ /(\w{3}) +(\w{3}) +(\d{1,2}) +(\d{2}):(\d{2}):\d{2} +(\d{4})$/ );
520   $ti="$hr:$min";
521   $da = sprintf("%02d", $da);
522   my $mo_num = $month2num{$mo};
523
524   my $offset = timegm(00, $min, $hr, $da, $mo_num-1, $yr-1900)-$unixtime;  
525   my $utc_offset = sprintf("%+03d", int($offset / 3600)).sprintf("%02d", ($offset % 3600)/60) ;
526
527   return ($dw,$mo,$mo_num,$da,$ti,$yr,$utc_offset);
528 }
529
530
531 # Default HTML and RSS template bits
532 __DATA__
533 html content_type text/html; charset=$blog_encoding
534
535 html head <html>
536 html head     <head>
537 html head         <meta http-equiv="content-type" content="text/html;charset=$blog_encoding" />
538 html head         <link rel="alternate" type="type="application/rss+xml" title="RSS" href="$url/index.rss" />
539 html head         <title>$blog_title $path_info_da $path_info_mo $path_info_yr
540 html head         </title>
541 html head     </head>
542 html head     <body>
543 html head         <center>
544 html head             <font size="+3">$blog_title</font><br />
545 html head             $path_info_da $path_info_mo $path_info_yr
546 html head         </center>
547 html head         <p />
548
549 html story        <p>
550 html story            <a name="$fn"><b>$title</b></a><br />
551 html story            $body<br />
552 html story            <br />
553 html story            posted at: $ti | path: <a href="$url$path">$path </a> | <a href="$url/$yr/$mo_num/$da#$fn">permanent link to this entry</a>
554 html story        </p>
555
556 html date         <h3>$dw, $da $mo $yr</h3>
557
558 html foot
559 html foot         <p />
560 html foot         <center>
561 html foot             <a href="http://blosxom.sourceforge.net/"><img src="http://blosxom.sourceforge.net/images/pb_blosxom.gif" border="0" /></a>
562 html foot         </center>
563 html foot     </body>
564 html foot </html>
565
566 rss content_type text/xml; charset=$blog_encoding
567
568 rss head <?xml version="1.0" encoding="$blog_encoding"?>
569 rss head <rss version="2.0">
570 rss head   <channel>
571 rss head     <title>$blog_title</title>
572 rss head     <link>$url/$path_info</link>
573 rss head     <description>$blog_description</description>
574 rss head     <language>$blog_language</language>
575 rss head     <docs>http://blogs.law.harvard.edu/tech/rss</docs>
576 rss head     <generator>blosxom/$version</generator>
577
578 rss story   <item>
579 rss story     <title>$title</title>
580 rss story     <pubDate>$dw, $da $mo $yr $ti:00 $utc_offset</pubDate>
581 rss story     <link>$url/$yr/$mo_num/$da#$fn</link>
582 rss story     <category>$path</category>
583 rss story     <guid isPermaLink="false">$path/$fn</guid>
584 rss story     <description>$body</description>
585 rss story   </item>
586
587 rss date 
588
589 rss foot   </channel>
590 rss foot </rss>
591
592 error content_type text/html
593
594 error head <html>
595 error head <body>
596 error head     <p><font color="red">Error: I'm afraid this is the first I've heard of a "$flavour" flavoured Blosxom.  Try dropping the "/+$flavour" bit from the end of the URL.</font></p>
597
598
599 error story <p><b>$title</b><br />
600 error story $body <a href="$url/$yr/$mo_num/$da#fn.$default_flavour">#</a></p>
601
602 error date <h3>$dw, $da $mo $yr</h3>
603
604 error foot     </body>
605 error foot </html>
606 __END__