return $tag;
}
+# Returns a tag name from a tag link
+sub tagname ($) {
+ my $tag=shift;
+ if (defined $config{tagbase}) {
+ $tag =~ s!^/\Q$config{tagbase}\E/!!;
+ } else {
+ $tag =~ s!^\.?/!!;
+ }
+ return pagetitle($tag, 1);
+}
+
sub htmllink_tag ($$$;@) {
my $page=shift;
my $destpage=shift;
debug($message);
my $template=template("autotag.tmpl");
- $template->param(tagname => IkiWiki::basename($tag));
+ $template->param(tagname => tagname($tag));
$template->param(tag => $tag);
writefile($tagfile, $config{srcdir}, $template->output);
if ($config{rcs}) {
IkiWiki::disable_commit_hook();
IkiWiki::rcs_add($tagfile);
- IkiWiki::rcs_commit_staged($message, undef, undef);
+ IkiWiki::rcs_commit_staged(message => $message);
IkiWiki::enable_commit_hook();
}
});
$template->param(tags => [
map {
- link => htmllink_tag($page, $destpage, $_, rel => "tag")
+ link => htmllink_tag($page, $destpage, $_,
+ rel => "tag", linktext => tagname($_))
}, sort keys %$tags
]) if defined $tags && %$tags && $template->query(name => "tags");
if ($template->query(name => "categories")) {
# It's an rss/atom template. Add any categories.
if (defined $tags && %$tags) {
- $template->param(categories => [map { category => $_ },
+ $template->param(categories => [map { category => tagname($_) },
sort keys %$tags]);
}
}