changeset 21:393cf6c9301b

2007-08-15 00:40:35 by steve Added the ability to have titles + subtitles to blogs. Added RSS logo.
author steve
date Wed, 15 Aug 2007 00:40:36 +0000
parents b029b7a32d6c
children b9a683f07bab
files bin/chronicle etc/chroniclerc themes/copyrighteous/entry.template themes/copyrighteous/index.template themes/copyrighteous/month.template themes/copyrighteous/tags.template themes/default/entry.template themes/default/index.template themes/default/month.template themes/default/style.css themes/default/tags.template themes/default/xml.gif
diffstat 12 files changed, 214 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- 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 );
--- 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
--- 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 @@
 <body>
 <div id='content'>
 <div id='title'>
-<span class="title">
- <a href="<!-- tmpl_var name='url_prefix' -->">Blog Title</a><br /></span>
+<span class="title"><a href="<!-- tmpl_var name='url_prefix' -->">
+  <!-- tmpl_if name='blog_title' -->
+    <!-- tmpl_var name='blog_title' -->
+  <!-- tmpl_else -->
+    Untitled Blog
+  <!-- /tmpl_if -->
+  </a><br /></span>
+  <!-- tmpl_if name='blog_subtitle' -->
+    <!-- tmpl_var name='blog_subtitle' -->
+  <!-- /tmpl_if -->
 </div>
+
 <br />
 <div class="blosxomFirstDayDiv">
 <span class="blosxomDate"><!-- tmpl_var name='date' --></span>
--- 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 @@
 <?xml version="1.0" encoding="utf-8"?>
 <html>
 <head>
- <title>copyrighteous: Blog Title</title>
+ <title>copyrighteous: <!-- tmpl_var name='blog_title' --></title>
   <link rel="stylesheet" type="text/css" media="screen" href="<!-- tmpl_var name='url_prefix' -->style.css">
   <link rel="alternate" title="RSS Feed" href="<!-- tmpl_var name='url_prefix' -->index.rss" type="application/rss+xml">
 </head>
@@ -9,8 +9,16 @@
 <body>
 <div id='content'>
 <div id='title'>
-<span class="title">
- <a href="<!-- tmpl_var name='url_prefix' -->">Blog Title</a><br /></span>
+<span class="title"><a href="<!-- tmpl_var name='url_prefix' -->">
+  <!-- tmpl_if name='blog_title' -->
+    <!-- tmpl_var name='blog_title' -->
+  <!-- tmpl_else -->
+    Untitled Blog
+  <!-- /tmpl_if -->
+  </a><br /></span>
+  <!-- tmpl_if name='blog_subtitle' -->
+    <!-- tmpl_var name='blog_subtitle' -->
+  <!-- /tmpl_if -->
 </div>
 
 <br />
--- 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 @@
 <body>
 <div id='content'>
 <div id='title'>
-<span class="title">
- <a href="<!-- tmpl_var name='url_prefix' -->">Blog Title</a><br /></span>
+<span class="title"><a href="<!-- tmpl_var name='url_prefix' -->">
+  <!-- tmpl_if name='blog_title' -->
+    <!-- tmpl_var name='blog_title' -->
+  <!-- tmpl_else -->
+    Untitled Blog
+  <!-- /tmpl_if -->
+  </a><br /></span>
+  <!-- tmpl_if name='blog_subtitle' -->
+    <!-- tmpl_var name='blog_subtitle' -->
+  <!-- /tmpl_if -->
 </div>
 
 <br />
--- 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 @@
 <body>
 <div id='content'>
 <div id='title'>
-<span class="title">
- <a href="<!-- tmpl_var name='url_prefix' -->">Blog Title</a><br /></span>
+<span class="title"><a href="<!-- tmpl_var name='url_prefix' -->">
+  <!-- tmpl_if name='blog_title' -->
+    <!-- tmpl_var name='blog_title' -->
+  <!-- tmpl_else -->
+    Untitled Blog
+  <!-- /tmpl_if -->
+  </a><br /></span>
+  <!-- tmpl_if name='blog_subtitle' -->
+    <!-- tmpl_var name='blog_subtitle' -->
+  <!-- /tmpl_if -->
 </div>
 
 <br />
--- 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 @@
  </head>
  <body>
 
+ <div class="title">
+  <h1><!-- tmpl_if name='blog_title' -->
+       <a href="<!-- tmpl_var name='url_prefix' -->"><!-- tmpl_var name='blog_title' --></a>
+      <!-- tmpl_else -->
+       Untitled Blog
+      <!-- /tmpl_if -->
+  </h1>
+  <!-- tmpl_if name='blog_subtitle' -->
+      <h2><!-- tmpl_var name='blog_subtitle' --></h2>
+  <!-- /tmpl_if -->
+ </div>
 
-<h1><a href="index.html">Blog</a> &gt; <!-- tmpl_var name='title' --></h1>
+
  <div class="entry">
   <div class="title"><!-- tmpl_var name='title' --></div>
   <div class="date"><!-- tmpl_var name='date' --></div>
--- 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">
 <html>
  <head>
-  <title>Blog: Index</title>
+  <title><!-- tmpl_var name='blog_title' --></title>
   <link rel="stylesheet" type="text/css" media="screen" href="<!-- tmpl_var name='url_prefix' -->style.css">
   <link rel="alternate" title="RSS Feed" href="<!-- tmpl_var name='url_prefix' -->index.rss" type="application/rss+xml">
 
  </head>
  <body>
 
- <h1>Most Recent Entries</h1>
+ <div class="title">
+  <h1><!-- tmpl_if name='blog_title' -->
+       <a href="<!-- tmpl_var name='url_prefix' -->"><!-- tmpl_var name='blog_title' --></a>
+      <!-- tmpl_else -->
+       Untitled Blog
+      <!-- /tmpl_if -->
+  </h1>
+  <!-- tmpl_if name='blog_subtitle' -->
+      <h2><!-- tmpl_var name='blog_subtitle' --></h2>
+  <!-- /tmpl_if -->
+ </div>
+
+ <p style="text-align: right;"><a href="index.rss"><img src="<!-- tmpl_if name='url_prefix' --><!-- tmpl_var name='url_prefix' --><!-- tmpl_else -->../../<!-- /tmpl_if -->xml.gif"></a></p>
 
  <!-- tmpl_loop name='entries' -->
  <div class="entry">
@@ -26,7 +38,7 @@
  </div>
  <div class="padding"></div>
  <!-- /tmpl_loop -->
-
+ <p style="text-align: right;"><a href="index.rss"><img src="<!-- tmpl_if name='url_prefix' --><!-- tmpl_var name='url_prefix' --><!-- tmpl_else -->../../<!-- /tmpl_if -->xml.gif"></a></p>
 
 <div id="sidebar">
 
--- a/themes/default/month.template	Tue Aug 14 21:15:45 2007 +0000
+++ b/themes/default/month.template	Wed Aug 15 00:40:36 2007 +0000
@@ -9,8 +9,19 @@
  <body>
 <!-- XML FEED -->
 
-<h1><a href="<!-- tmpl_if name='url_prefix' --><!-- tmpl_var name='url_prefix' --><!-- tmpl_else -->../../<!-- /tmpl_if -->">Blog</a> &gt; Entries from <!-- tmpl_var name='month' --> <!-- tmpl_var name='year' --></h1>
-<p>If you wish you may subscribe to an <a href="<!-- tmpl_var name='month' escape='html' -->.rss">RSS feed</a> of matching entries.</p>
+ <div class="title">
+  <h1><!-- tmpl_if name='blog_title' -->
+       <a href="<!-- tmpl_if name='url_prefix' --><!-- tmpl_var name='url_prefix' --><!-- tmpl_else -->../../<!-- /tmpl_if -->"><!-- tmpl_var name='blog_title' --></a>
+      <!-- tmpl_else -->
+       Untitled Blog
+      <!-- /tmpl_if -->
+  </h1>
+  <!-- tmpl_if name='blog_subtitle' -->
+      <h2><!-- tmpl_var name='blog_subtitle' --></h2>
+  <!-- /tmpl_if -->
+ </div>
+
+ <p style="text-align: right;"><a href="<!-- tmpl_var name='month' escape='html' -->.rss"><img src="<!-- tmpl_if name='url_prefix' --><!-- tmpl_var name='url_prefix' --><!-- tmpl_else -->../../<!-- /tmpl_if -->xml.gif"></a></p>
 
 <!-- tmpl_loop name='entries' -->
 <div class="entry">
@@ -34,6 +45,8 @@
 </div>
  <div class="padding"></div>
 <!-- /tmpl_loop -->
+ <p style="text-align: right;"><a href="<!-- tmpl_var name='month' escape='html' -->.rss"><img src="<!-- tmpl_if name='url_prefix' --><!-- tmpl_var name='url_prefix' --><!-- tmpl_else -->../../<!-- /tmpl_if -->xml.gif"></a></p>
+
 
 
 <div id="sidebar">
--- a/themes/default/style.css	Tue Aug 14 21:15:45 2007 +0000
+++ b/themes/default/style.css	Wed Aug 15 00:40:36 2007 +0000
@@ -10,6 +10,29 @@
 	margin-right: 185px;
 }
 
+div.title {
+}
+
+div.title h1 {
+        margin: 0px -10px;
+	padding: 5px 10px 0px 10px;
+	text-align: center;
+}
+
+div.title a {
+	color: black !important;
+	text-decoration: none !important;
+}
+div.title a:hover {
+	color: black !important;
+	text-decoration: none !important;
+}
+
+div.title h2 {
+	margin: 0 0 1ex 0;
+	padding: 0;
+        text-align: right;
+}
 
 /*
  * Special markup for weblog entries.
--- a/themes/default/tags.template	Tue Aug 14 21:15:45 2007 +0000
+++ b/themes/default/tags.template	Wed Aug 15 00:40:36 2007 +0000
@@ -8,9 +8,19 @@
  </head>
  <body>
 
-<h1><a href="<!-- tmpl_if name='url_prefix' --><!-- tmpl_var name='url_prefix' --><!-- tmpl_else -->../../<!-- /tmpl_if -->">Blog</a> &gt; Entries Tagged &quot;<tt><!-- tmpl_var name='tagname' --></tt>&quot;</h1>
+ <div class="title">
+  <h1><!-- tmpl_if name='blog_title' -->
+       <a href="<!-- tmpl_if name='url_prefix' --><!-- tmpl_var name='url_prefix' --><!-- tmpl_else -->../../<!-- /tmpl_if -->"><!-- tmpl_var name='blog_title' --></a>
+      <!-- tmpl_else -->
+       Untitled Blog
+      <!-- /tmpl_if -->
+  </h1>
+  <!-- tmpl_if name='blog_subtitle' -->
+      <h2><!-- tmpl_var name='blog_subtitle' --></h2>
+  <!-- /tmpl_if -->
+ </div>
 
-<p>If you wish you may subscribe to an <a href="<!-- tmpl_var name='tagname' escape='html' -->.rss">RSS feed</a> of matching entries.</p>
+ <p style="text-align: right;"><a href="<!-- tmpl_var name='tagname' escape='html' -->.rss"><img src="<!-- tmpl_if name='url_prefix' --><!-- tmpl_var name='url_prefix' --><!-- tmpl_else -->../../<!-- /tmpl_if -->xml.gif"></a></p>
 
 
 <!-- tmpl_loop name='entries' -->
@@ -33,6 +43,7 @@
 </div>
 <div class="padding"></div>
 <!-- /tmpl_loop -->
+ <p style="text-align: right;"><a href="<!-- tmpl_var name='tagname' escape='html' -->.rss"><img src="<!-- tmpl_if name='url_prefix' --><!-- tmpl_var name='url_prefix' --><!-- tmpl_else -->../../<!-- /tmpl_if -->xml.gif"></a></p>
 
 
 
Binary file themes/default/xml.gif has changed