use warnings;
use strict;
use IkiWiki 1.00;
-use IkiWiki::Render; # for displaytime
use URI;
sub import { #{{{
if ($actions) {
my $file = $pagesources{$page};
my $type = pagetype($file);
- if ($config{discussion} && (length $config{cgiurl} || exists $links{$page."/".gettext("discussion")})) {
- $template->param(have_actions => 1);
- $template->param(discussionlink => htmllink($page, $params{page}, "Discussion", 1, 1));
+ if ($config{discussion}) {
+ my $discussionlink=gettext("discussion");
+ if ($page !~ /.*\/\Q$discussionlink\E$/ &&
+ (length $config{cgiurl} ||
+ exists $links{$page."/".$discussionlink})) {
+ $template->param(have_actions => 1);
+ $template->param(discussionlink => htmllink($page, $params{page}, gettext("Discussion"), 1, 1));
+ }
}
if (length $config{cgiurl} && defined $type) {
$template->param(have_actions => 1);
eval q{use POSIX};
error($@) if $@;
- my $lc_time= POSIX::setlocale(&POSIX::LC_TIME);
+ my $lc_time=POSIX::setlocale(&POSIX::LC_TIME);
POSIX::setlocale(&POSIX::LC_TIME, "C");
my $ret=POSIX::strftime("%a, %d %b %Y %H:%M:%S %z", localtime($time));
POSIX::setlocale(&POSIX::LC_TIME, $lc_time);
eval q{use POSIX};
error($@) if $@;
- my $lc_time= POSIX::setlocale(&POSIX::LC_TIME);
+ my $lc_time=POSIX::setlocale(&POSIX::LC_TIME);
POSIX::setlocale(&POSIX::LC_TIME, "C");
my $ret=POSIX::strftime("%Y-%m-%dT%H:%M:%SZ", localtime($time));
POSIX::setlocale(&POSIX::LC_TIME, $lc_time);