X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/dd349d69ea2361360b4534d9c77806345ff490ad..b540b263debef11d305b85f4dc85a6807b782810:/IkiWiki/Plugin/inline.pm diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index a6bb5d58f..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}) { @@ -364,7 +370,7 @@ sub preprocess_inline (@) { #{{{ if (! $params{preview}) { writefile($rssp, $config{destdir}, genfeed("rss", - $config{url}."/".rsspage($params{destpage}).$feednum, $desc, $params{guid}, $params{destpage}, @feedlist)); + $config{url}."/".$rssp, $desc, $params{guid}, $params{destpage}, @feedlist)); $toping{$params{destpage}}=1 unless $config{rebuild}; $feedlinks{$params{destpage}}=qq{}; } @@ -374,7 +380,7 @@ sub preprocess_inline (@) { #{{{ will_render($params{destpage}, $atomp); if (! $params{preview}) { writefile($atomp, $config{destdir}, - genfeed("atom", $config{url}."/".atompage($params{destpage}).$feednum, $desc, $params{guid}, $params{destpage}, @feedlist)); + genfeed("atom", $config{url}."/".$atomp, $desc, $params{guid}, $params{destpage}, @feedlist)); $toping{$params{destpage}}=1 unless $config{rebuild}; $feedlinks{$params{destpage}}=qq{}; }