if ($self->title() eq 'new') {
return qq{\n\n};
}
return '';
${title}
# linkbar
my $title = $self->title;
my $output;
my (%description) =
(
new => 'newest entries',
all => 'all entries',
chapbook => 'unrequired poetry',
hack => 'code and such',
1997 => 'entries for 1997',
1998 => 'entries for 1998',
1999 => 'entries for 1999',
2000 => 'entries for 2000',
2001 => 'entries for 2001',
2002 => 'entries for 2001',
2003 => 'entries for 2003',
2004 => 'entries for 2004',
2005 => 'entries for 2005',
2006 => 'entries for 2006',
2007 => 'entries for 2007',
2008 => 'entries for 2008',
feed => 'an Atom feed of new entries',
);
my @years = qw(2008 2007 2006 2005 2004 2003 2002 2001 2000 1999 1998 1997);
# This makes the short list of years in the title context sensitive:
if ( my ($title_year) = $title =~ m/^([0-9]{4})/ ) {
# We have a match.
if ($title_year == $years[0] ) { $title_year--; }
elsif ($title_year == $years[-1]) { $title_year++; }
if (grep { $title_year eq $_ } @years) {
my $prev = $title_year - 1;
my $next = $title_year + 1;
@years = grep { m/^($prev|$title_year|$next)$/ } @years;
}
} else {
@years = @years[0..2];
}
my @linklist = ( qw(new all), @years, qw(chapbook hack feed) );
foreach my $link (@linklist) {
if ($title ne $link) {
my $href = $self->url_root . $link;
if ($link eq 'new') {
$href = $self->url_root;
}
$output .= a("href: $href", "title: $description{$link}", $link) . " \n";
} else {
$output .= qq{$link \n};
}
}
return p($output);