diffurl => '',
anonok => 0,
rss => 0,
+ discussion => 1,
rebuild => 0,
refresh => 0,
getctime => 0,
foreach my $page (%IkiWiki::links) {
if (IkiWiki::globlist_match($page, $params{pages})) {
foreach my $link (@{$IkiWiki::links{$page}}) {
- next if $link =~ /.*\/discussion/i;
+ next if $link =~ /.*\/discussion/i && $IkiWiki::config{discussion};
my $bestlink=IkiWiki::bestlink($page, $link);
next if length $bestlink;
push @broken,
next unless IkiWiki::globlist_match($page, $params{pages});
# If the page has a link to some other page, it's
# indirectly linked to a page via that page's backlinks.
- next if grep { length $_ && $_ !~/\/Discussion$/i && IkiWiki::bestlink($page, $_) ne $page } @{$IkiWiki::links{$page}};
+ next if grep { length $_ && ($_ !~/\/Discussion$/i || ! $IkiWiki::config{discussion}) && IkiWiki::bestlink($page, $_) ne $page } @{$IkiWiki::links{$page}};
push @orphans, $page;
}
$u=~s/\[\[file\]\]/$pagesources{$page}/g;
$template->param(historyurl => $u);
}
+ if ($config{discussion}) {
+ $template->param(discussionlink => htmllink($page, "Discussion", 1, 1));
+ }
$template->param(headercontent => $config{headercontent});
$template->param(
parentlinks => [parentlinks($page)],
content => $content,
backlinks => [backlinks($page)],
- discussionlink => htmllink($page, "Discussion", 1, 1),
mtime => scalar(gmtime($mtime)),
styleurl => styleurl($page),
);
while ($content =~ /(?<!\\)$config{wiki_link_regexp}/g) {
push @links, titlepage($2);
}
- # Discussion links are a special case since they're not in the text
- # of the page, but on its template.
- return @links, "$page/discussion";
+ if ($config{discussion}) {
+ # Discussion links are a special case since they're not in the
+ # text of the page, but on its template.
+ return @links, "$page/discussion";
+ }
+ else {
+ return @links;
+ }
} #}}}
sub render ($) { #{{{
extra_build:
./ikiwiki doc html --templatedir=templates --underlaydir=basewiki \
--wikiname="ikiwiki" --verbose --no-rcs \
- --exclude=/discussion --plugin=brokenlinks \
- --plugin=pagecount --plugin=orphans \
- --plugin=haiku
+ --exclude=/discussion --no-discussion \
+ --plugin=brokenlinks --plugin=pagecount \
+ --plugin=orphans --plugin=haiku
./mdwn2man doc/usage.mdwn > ikiwiki.man
extra_clean:
text.
* Removed --sanitize and --no-sanitize, replaced with --plugin htmlscrubber
and --disable-plugin htmlscrubber.
+ * Allow discussion links on pages to be turned off with --no-discussion.
- -- Joey Hess <joeyh@debian.org> Fri, 5 May 2006 01:28:19 -0400
+ -- Joey Hess <joeyh@debian.org> Fri, 5 May 2006 14:03:54 -0400
ikiwiki (1.0) unstable; urgency=low
#anonok => 1,
# Generate rss feeds for pages?
rss => 1,
+ # Include discussion links on all pages?
+ discussion => 1,
# To change the enabled plugins, edit this list
#plugin => [qw{pagecount inline brokenlinks hyperestraier smiley
# htmlscrubber}],
* Don't render blog archive pages unless a page is added/removed. Just
changing a page doesn't affect the archives as they show only the title.
-* Look at breaking the relatively rarely used blogging stuff out of
- Render.pm, into its own module.
-
* Look at splitting up CGI.pm. But note that too much splitting can slow
perl down.
Disables use of a plugin. For example "--disable-plugin htmlscrubber"
to do away with html sanitization.
+* --discussion, --no-discussion
+
+ Enables or disables "Discussion" links from being added to the header of
+ every page. The links are enabled by default.
+
* --verbose
Be vebose about what is being done.
"anonok!" => \$config{anonok},
"rss!" => \$config{rss},
"cgi!" => \$config{cgi},
+ "discussion!" => \$config{discussion},
"notify!" => \$config{notify},
"url=s" => \$config{url},
"cgiurl=s" => \$config{cgiurl},
<li><a href="<TMPL_VAR PREFSURL>">Preferences</a></li>
</TMPL_IF>
+<TMPL_IF NAME="DISCUSSIONLINK">
<li><TMPL_VAR DISCUSSIONLINK><br /></li>
+</TMPL_IF>
</ul>
</div>