X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/0f67e7d96953535e98d9ec26c30a25b8aaad782c..9ec9d6901d444af48555abf7b4c26d1965c46017:/IkiWiki/Plugin/inline.pm diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index a6bb5d58f..e0f33ef31 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -119,7 +119,7 @@ sub sessioncgi () { #{{{ my $session=shift; if ($q->param('do') eq 'blog') { - my $page=IkiWiki::titlepage(decode_utf8($q->param('title'))); + my $page=titlepage(decode_utf8($q->param('title'))); $page=~s/(\/)/"__".ord($1)."__"/eg; # don't create subdirs # if the page already exists, munge it to be unique my $from=$q->param('from'); @@ -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{}; }