aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/inline.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-12-11 14:04:38 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-12-11 14:04:38 -0500
commit63eb9d834e2f7e08535473934e169cfe7d7debe6 (patch)
treed5b9fd69d78aa10a6cf6f3a706749a2727522f91 /IkiWiki/Plugin/inline.pm
parent38f5e3ba6944ab67bff87fdbb2cc50606b806085 (diff)
downloadikiwiki-63eb9d834e2f7e08535473934e169cfe7d7debe6.tar
ikiwiki-63eb9d834e2f7e08535473934e169cfe7d7debe6.tar.gz
inline: Support emptyfeeds=no option to skip generating empty feeds.
Diffstat (limited to 'IkiWiki/Plugin/inline.pm')
-rw-r--r--IkiWiki/Plugin/inline.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 0c8f50384..5e4df95f4 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -161,6 +161,7 @@ sub preprocess_inline (@) { #{{{
my $atom=(($config{atom} || $config{allowatom}) && exists $params{atom}) ? yesno($params{atom}) : $config{atom};
my $quick=exists $params{quick} ? yesno($params{quick}) : 0;
my $feeds=exists $params{feeds} ? yesno($params{feeds}) : !$quick;
+ my $emptyfeeds=exists $params{emptyfeeds} ? yesno($params{emptyfeeds}) : 1;
my $feedonly=yesno($params{feedonly});
if (! exists $params{show} && ! $archive) {
$params{show}=10;
@@ -289,8 +290,13 @@ sub preprocess_inline (@) { #{{{
gettext("Add a new post titled:"));
}
$ret.=$formtemplate->output;
+
+ # The post form includes the feed buttons, so
+ # emptyfeeds cannot be hidden.
+ $emptyfeeds=1;
}
- elsif ($feeds && !$params{preview}) {
+ elsif ($feeds && !$params{preview} &&
+ ! (! $emptyfeeds && ! @feedlist)) {
# Add feed buttons.
my $linktemplate=template("feedlink.tmpl", blind_cache => 1);
$linktemplate->param(rssurl => $rssurl) if $rss;
@@ -367,7 +373,7 @@ sub preprocess_inline (@) { #{{{
}
}
- if ($feeds) {
+ if ($feeds && ! (! $emptyfeeds && ! @feedlist)) {
if ($rss) {
my $rssp=rsspage($params{destpage}).$feednum;
will_render($params{destpage}, $rssp);