From 364a736f0bce810faa7f809d4eb6cd74c2972d5b Mon Sep 17 00:00:00 2001 From: Kevin Scaldeferri Date: Mon, 10 Jul 2006 20:22:45 +0000 Subject: [PATCH] allow newlines in DATA section flavours for greater readability --- blosxom.cgi | 85 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 70 insertions(+), 15 deletions(-) diff --git a/blosxom.cgi b/blosxom.cgi index 920a783..068b718 100755 --- a/blosxom.cgi +++ b/blosxom.cgi @@ -139,10 +139,10 @@ $template = # Bring in the templates %template = (); while () { - last if /^(__END__)?$/; - my($ct, $comp, $txt) = /^(\S+)\s(\S+)\s(.*)$/; + last if /^(__END__)$/; + my($ct, $comp, $txt) = /^(\S+)\s(\S+)\s(.*)$/ or next; $txt =~ s/\\n/\n/mg; - $template{$ct}{$comp} = $txt; + $template{$ct}{$comp} .= $txt . "\n"; } # Plugins: Start @@ -439,18 +439,73 @@ sub nice_date { # Default HTML and RSS template bits __DATA__ html content_type text/html -html head $blog_title $path_info_da $path_info_mo $path_info_yr
$blog_title
$path_info_da $path_info_mo $path_info_yr

-html story

$title
$body

posted at: $ti | path: $path | permanent link to this entry

\n -html date

$dw, $da $mo $yr

\n -html foot

+ +html head +html head +html head +html head $blog_title $path_info_da $path_info_mo $path_info_yr +html head +html head +html head +html head
+html head $blog_title
+html head $path_info_da $path_info_mo $path_info_yr +html head
+html head

+ +html story

+html story $title
+html story $body
+html story
+html story posted at: $ti | path: $path | permanent link to this entry +html story

+ +html date

$dw, $da $mo $yr

+ +html foot +html foot

+html foot

+html foot +html foot
+html foot +html foot + rss content_type text/xml -rss head \n\n\n\n\n \n $blog_title $path_info_da $path_info_mo $path_info_yr\n $url\n $blog_description\n $blog_language\n -rss story \n $title\n $url/$yr/$mo_num/$da#$fn\n $body\n \n -rss date \n -rss foot \n + +rss head +rss head +rss head +rss head +rss head +rss head +rss head $blog_title $path_info_da $path_info_mo $path_info_yr +rss head $url +rss head $blog_description +rss head $blog_language + +rss story +rss story $title +rss story $url/$yr/$mo_num/$da#$fn +rss story $body +rss story + +rss date + +rss foot +rss foot + error content_type text/html -error head

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.\n\n -error story

$title
$body #

\n -error date

$dw, $da $mo $yr

\n -error foot + +error head +error head +error head

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. + + +error story

$title
+error story $body #

+ +error date

$dw, $da $mo $yr

+ +error foot +error foot __END__ -- 2.30.2