# HG changeset patch # User steve # Date 1187138436 0 # Node ID 393cf6c9301b3fad7d68e5659757269f447bdf82 # Parent b029b7a32d6c666f01cb8b35a38bd9276604a353 2007-08-15 00:40:35 by steve Added the ability to have titles + subtitles to blogs. Added RSS logo. diff -r b029b7a32d6c -r 393cf6c9301b bin/chronicle --- a/bin/chronicle Tue Aug 14 21:15:45 2007 +0000 +++ b/bin/chronicle Wed Aug 15 00:40:36 2007 +0000 @@ -54,7 +54,7 @@ -- http://www.steve.org.uk/ - $Id: chronicle,v 1.9 2007-08-14 18:10:18 steve Exp $ + $Id: chronicle,v 1.10 2007-08-15 00:40:35 steve Exp $ =cut @@ -330,7 +330,7 @@ if ( $VERSION ) { - my $REVISION = '$Revision: 1.9 $'; + my $REVISION = '$Revision: 1.10 $'; if ( $REVISION =~ /1.([0-9.]+) / ) { $REVISION = $1; @@ -782,11 +782,30 @@ # # Open the index template. # - my $template = loadTemplate( "index.template" ); + my $template = loadTemplate( "index.template", + die_on_bad_params => 0 ); + + # + # The entries. + # + $template->param( entries => $entries ) + if ( $entries ); - $template->param( entries => $entries ) if ( $entries ); - $template->param( tagcloud => $CLOUD{'tag'} ) if ( $CLOUD{'tag'} ); - $template->param( datecloud => $CLOUD{'archive'} ) if ( $CLOUD{'archive'} ); + # + # The clouds + # + $template->param( tagcloud => $CLOUD{'tag'} ) + if ( $CLOUD{'tag'} ); + $template->param( datecloud => $CLOUD{'archive'} ) + if ( $CLOUD{'archive'} ); + + # + # Blog title and subtitle, if present. + # + $template->param( blog_title => $CONFIG{'blog_title'} ) + if ( $CONFIG{'blog_title'} ); + $template->param( blog_subtitle => $CONFIG{'blog_subtitle'} ) + if ( $CONFIG{'blog_subtitle'} ); # # Page to use @@ -870,11 +889,31 @@ # # Now write the output as a HTML page. # - my $template = loadTemplate( "tags.template" ); + my $template = loadTemplate( "tags.template", + die_on_bad_params => 0 ); + + # + # The entries. + # $template->param( entries => $entries ) if ( $entries ); $template->param( tagname => $tagName ); - $template->param( tagcloud => $CLOUD{'tag'} ) if ( $CLOUD{'tag'} ); - $template->param( datecloud => $CLOUD{'archive'} ) if ( $CLOUD{'archive'} ); + + # + # The clouds + # + $template->param( tagcloud => $CLOUD{'tag'} ) + if ( $CLOUD{'tag'} ); + $template->param( datecloud => $CLOUD{'archive'} ) + if ( $CLOUD{'archive'} ); + + # + # Blog title and subtitle, if present. + # + $template->param( blog_title => $CONFIG{'blog_title'} ) + if ( $CONFIG{'blog_title'} ); + $template->param( blog_subtitle => $CONFIG{'blog_subtitle'} ) + if ( $CONFIG{'blog_subtitle'} ); + # # Page to use @@ -983,11 +1022,30 @@ # # Now write the output as a HTML page. # - my $template = loadTemplate( "month.template" ); + my $template = loadTemplate( "month.template", + die_on_bad_params => 0 ); + + # + # The entries. + # $template->param( entries => $entries ) if ( $entries ); $template->param( year => $year, month => $month ); - $template->param( tagcloud => $CLOUD{'tag'} ) if ( $CLOUD{'tag'} ); - $template->param( datecloud => $CLOUD{'archive'} ) if ( $CLOUD{'archive'} ); + + # + # The clouds + # + $template->param( tagcloud => $CLOUD{'tag'} ) + if ( $CLOUD{'tag'} ); + $template->param( datecloud => $CLOUD{'archive'} ) + if ( $CLOUD{'archive'} ); + + # + # Blog title and subtitle, if present. + # + $template->param( blog_title => $CONFIG{'blog_title'} ) + if ( $CONFIG{'blog_title'} ); + $template->param( blog_subtitle => $CONFIG{'blog_subtitle'} ) + if ( $CONFIG{'blog_subtitle'} ); # # Page to use @@ -1026,7 +1084,8 @@ # # Load the template # - my $template = loadTemplate( "entry.template" ); + my $template = loadTemplate( "entry.template", + die_on_bad_params => 0 ); # # Just the name of the file. @@ -1054,12 +1113,28 @@ my $file = fileToTitle($title); $file = $CONFIG{'output'} . "/" . $file; + # + # The entry. + # $template->param( title => $title ); $template->param( tags => $tags ) if ( $tags ); $template->param( date => $date ) if ( $date ); $template->param( body => $body ); + + # + # Our clouds + # $template->param( tagcloud => $CLOUD{'tag'} ) if ( $CLOUD{'tag'} ); $template->param( datecloud => $CLOUD{'archive'} ) if ( $CLOUD{'archive'} ); + + # + # Blog title and subtitle, if present. + # + $template->param( blog_title => $CONFIG{'blog_title'} ) + if ( $CONFIG{'blog_title'} ); + $template->param( blog_subtitle => $CONFIG{'blog_subtitle'} ) + if ( $CONFIG{'blog_subtitle'} ); + open( OUTPUT, ">", $file ); print OUTPUT $template->output(); close( OUTPUT ); diff -r b029b7a32d6c -r 393cf6c9301b etc/chroniclerc --- a/etc/chroniclerc Tue Aug 14 21:15:45 2007 +0000 +++ b/etc/chroniclerc Wed Aug 15 00:40:36 2007 +0000 @@ -101,6 +101,12 @@ # +# The title for the Blog +# +blog_title = Steve Kemp's Blog +blog_subtitle = Free Software & Debian + +# # A command to run pre-build # # pre-build = cvs update -A -d diff -r b029b7a32d6c -r 393cf6c9301b themes/copyrighteous/entry.template --- a/themes/copyrighteous/entry.template Tue Aug 14 21:15:45 2007 +0000 +++ b/themes/copyrighteous/entry.template Wed Aug 15 00:40:36 2007 +0000 @@ -8,9 +8,18 @@
- - Blog Title
+ + + + + Untitled Blog + +
+ + +
+
diff -r b029b7a32d6c -r 393cf6c9301b themes/copyrighteous/index.template --- a/themes/copyrighteous/index.template Tue Aug 14 21:15:45 2007 +0000 +++ b/themes/copyrighteous/index.template Wed Aug 15 00:40:36 2007 +0000 @@ -1,7 +1,7 @@ - copyrighteous: Blog Title + copyrighteous: <!-- tmpl_var name='blog_title' --> @@ -9,8 +9,16 @@

diff -r b029b7a32d6c -r 393cf6c9301b themes/copyrighteous/month.template --- a/themes/copyrighteous/month.template Tue Aug 14 21:15:45 2007 +0000 +++ b/themes/copyrighteous/month.template Wed Aug 15 00:40:36 2007 +0000 @@ -9,8 +9,16 @@

diff -r b029b7a32d6c -r 393cf6c9301b themes/copyrighteous/tags.template --- a/themes/copyrighteous/tags.template Tue Aug 14 21:15:45 2007 +0000 +++ b/themes/copyrighteous/tags.template Wed Aug 15 00:40:36 2007 +0000 @@ -9,8 +9,16 @@

diff -r b029b7a32d6c -r 393cf6c9301b themes/default/entry.template --- a/themes/default/entry.template Tue Aug 14 21:15:45 2007 +0000 +++ b/themes/default/entry.template Wed Aug 15 00:40:36 2007 +0000 @@ -7,8 +7,19 @@ +
+

+ + + Untitled Blog + +

+ +

+ +
-

Blog >

+
diff -r b029b7a32d6c -r 393cf6c9301b themes/default/index.template --- a/themes/default/index.template Tue Aug 14 21:15:45 2007 +0000 +++ b/themes/default/index.template Wed Aug 15 00:40:36 2007 +0000 @@ -2,14 +2,26 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - Blog: Index + <!-- tmpl_var name='blog_title' --> -

Most Recent Entries

+
+

+ + + Untitled Blog + +

+ +

+ +
+ +

@@ -26,7 +38,7 @@
- +