aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-03-21 23:11:09 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-03-21 23:11:09 +0000
commit2a0d91af2f8f6ca3142c8f73ea6869e7a914bb30 (patch)
treed4c7c3dae158e8603cd1a3c01fd8784ef478ba2e /IkiWiki
parent0daec2bf14871072a4b3d3aebbbfc5eaa7608ef5 (diff)
downloadikiwiki-2a0d91af2f8f6ca3142c8f73ea6869e7a914bb30.tar
ikiwiki-2a0d91af2f8f6ca3142c8f73ea6869e7a914bb30.tar.gz
* Fix link() PageSpecs to not just look at the raw link text, but at where
that given link points based on the page doing the linking. Note that this could make such PageSpecs match different things than before, if you relied on the old behavior of them only matching the raw link text. * This required changing the match_* interface, adding a third parameter. * Allow link() PageSpecs to match relative, as is allowed with globs.a * Add postform option to inline plugin. * Add an bug tracker to the softwaresite example.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/conditional.pm10
-rw-r--r--IkiWiki/Plugin/inline.pm6
2 files changed, 9 insertions, 7 deletions
diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm
index ed533109a..22057c135 100644
--- a/IkiWiki/Plugin/conditional.pm
+++ b/IkiWiki/Plugin/conditional.pm
@@ -28,7 +28,7 @@ sub preprocess_if (@) { #{{{
# tests.
if ($params{test} =~ /^(enabled|sourcepage|destpage)\((.*)\)$/) {
$result=eval "IkiWiki::PageSpec::match_$1(undef, ".
- IkiWiki::safequote($2).")";
+ IkiWiki::safequote($2).", \$params{page})";
}
else {
add_depends($params{page}, $params{test});
@@ -59,7 +59,7 @@ sub preprocess_if (@) { #{{{
package IkiWiki::PageSpec;
-sub match_enabled ($$) { #{{{
+sub match_enabled ($$$) { #{{{
shift;
my $plugin=shift;
@@ -67,7 +67,7 @@ sub match_enabled ($$) { #{{{
return UNIVERSAL::can("IkiWiki::Plugin::".$plugin, "import");
} #}}}
-sub match_sourcepage ($$) { #{{{
+sub match_sourcepage ($$$) { #{{{
shift;
my $glob=shift;
@@ -75,7 +75,7 @@ sub match_sourcepage ($$) { #{{{
$IkiWiki::Plugin::conditional::sourcepage);
} #}}}
-sub match_destpage ($$) { #{{{
+sub match_destpage ($$$) { #{{{
shift;
my $glob=shift;
@@ -83,7 +83,7 @@ sub match_destpage ($$) { #{{{
$IkiWiki::Plugin::conditional::sourcepage);
} #}}}
-sub match_included ($$) { #{{{
+sub match_included ($$$) { #{{{
return $IkiWiki::Plugin::conditional::sourcepage ne $IkiWiki::Plugin::conditional::destpage;
} #}}}
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 4dbf9f159..3a2e0a05f 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -121,11 +121,13 @@ sub preprocess_inline (@) { #{{{
my $atomurl=atompage(basename($params{page}));
my $ret="";
- if (exists $params{rootpage} && $config{cgiurl}) {
+ if ($config{cgiurl} && (exists $params{rootpage} ||
+ (exists $params{postform} && yesno($params{postform})))) {
# Add a blog post form, with feed buttons.
my $formtemplate=template("blogpost.tmpl", blind_cache => 1);
$formtemplate->param(cgiurl => $config{cgiurl});
- $formtemplate->param(rootpage => $params{rootpage});
+ $formtemplate->param(rootpage =>
+ exists $params{rootpage} ? $params{rootpage} : $params{page});
$formtemplate->param(rssurl => $rssurl) if $feeds && $rss;
$formtemplate->param(atomurl => $atomurl) if $feeds && $atom;
$ret.=$formtemplate->output;