theory / blosxom-plugins forked from hail2u/blosxom-plugins

various plugin for blosxom 2.x

This URL has Read+Write access

blosxom-plugins / date_title
100644 45 lines (30 sloc) 0.797 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Blosxom Plugin: date_title
# Author(s): Kyo Nagashima <kyo@hail2u.net>
# Version: 2009-04-04T10:37:57+09:00
# Blosxom Home/Docs/Licensing: http://www.blosxom.com/
 
package date_title;
 
use strict;
use vars qw($title);
 
# --- Configurable variables -----------
 
# separator string between $blog_title and $path_info_yr
my $title_sep = " - ";
 
# --- Plug-in package variables --------
 
# --------------------------------------
 
sub start {
  if (!$blosxom::path_info_yr) {
    return 0;
  }
 
  return 1;
}
 
sub head {
  my ($pkg, $path, $head_ref) = @_;
 
  $title = qq!$title_sep$blosxom::path_info_yr!;
 
  if ($blosxom::path_info_mo_num) {
    $title .= qq!/$blosxom::path_info_mo_num!;
 
    if ($blosxom::path_info_da) {
      $title .= qq!/$blosxom::path_info_da!;
    }
  }
 
  return 1;
}
 
1;