Previously, the filename was always used. Now there is a configuration
option, $related_story_title, which is disabled by default but allows
showing the title instead.
our $related_story_prefix = '<li class="related_stories">' unless defined $related_story_prefix;
our $related_story_suffix = '</li>' unless defined $related_story_suffix;
our $related_story_class = 'related_stories' unless defined $related_story_class;
our $related_story_prefix = '<li class="related_stories">' unless defined $related_story_prefix;
our $related_story_suffix = '</li>' unless defined $related_story_suffix;
our $related_story_class = 'related_stories' unless defined $related_story_class;
+# Use the title of the post for the link instead of the filename
+our $related_story_title = 0 unless defined $related_story_title;
our $shared_tags_text = 'shared tags' unless defined $shared_tags_text;
our $shared_tags_text = 'shared tags' unless defined $shared_tags_text;
$related_tags = '';
%tags = ();
$related_tags = '';
%tags = ();
%related_tags = ();
sub start {
%related_tags = ();
sub start {
$opath =~ s!\Q$blosxom::datadir\E!$blosxom::url!;
$opath =~ s!\Q$blosxom::file_extension\E$!$blosxom::default_flavour!;
$opath =~ s!\Q$blosxom::datadir\E!$blosxom::url!;
$opath =~ s!\Q$blosxom::file_extension\E$!$blosxom::default_flavour!;
- my $title = $other;
- $title =~ s!^.*/([^/]+)\.$blosxom::file_extension$!$1!;
+ my $title;
+ if ($related_story_title) {
+ $title = $titles{$other};
+ } else {
+ $title = $other;
+ $title =~ s!^.*/([^/]+)\.$blosxom::file_extension$!$1!;
+ }
my $shared_tags_list = join(', ', @{$other_stories{$other}});
my $shared_tags_number = scalar(@{$other_stories{$other}});
my $shared_tags_list = join(', ', @{$other_stories{$other}});
my $shared_tags_number = scalar(@{$other_stories{$other}});
my $tags_found = 0;
my $empty_line_found = 0;
while ($_ = <FILE>) {
my $tags_found = 0;
my $empty_line_found = 0;
while ($_ = <FILE>) {
+ # Take the title from the first line
+ if (not defined $titles{$key}) {
+ $titles{$key} = $_;
+ }
last if /^\s*$/;
if (m!^$tag_re(.+?)$!) {
my @localtags = split($split_re, $1);
last if /^\s*$/;
if (m!^$tag_re(.+?)$!) {
my @localtags = split($split_re, $1);