X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/f888ceafee5aef67824c808667d6f2df02286968..89953e3e19d3e5fb0f5c9d47e3905fde27ab08cb:/IkiWiki/Plugin/inline.pm

diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 02c9cbdc0..8efef3fc8 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -263,8 +263,14 @@ sub preprocess_inline (@) { #{{{
 		# Add a blog post form, with feed buttons.
 		my $formtemplate=template("blogpost.tmpl", blind_cache => 1);
 		$formtemplate->param(cgiurl => $config{cgiurl});
-		$formtemplate->param(rootpage => 
-			exists $params{rootpage} ? $params{rootpage} : $params{page});
+		my $rootpage;
+		if (exists $params{rootpage}) {
+			$rootpage=bestlink($params{page}, $params{rootpage});
+		}
+		else {
+			$rootpage=$params{page};
+		}
+		$formtemplate->param(rootpage => $rootpage);
 		$formtemplate->param(rssurl => $rssurl) if $feeds && $rss;
 		$formtemplate->param(atomurl => $atomurl) if $feeds && $atom;
 		if (exists $params{postformtext}) {