X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/7029f98bc735efcec08213d51bdec2c6645d682d..cd5a24d8b405902801ca710cb77d6cc3f802f90f:/IkiWiki/Plugin/trail.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/trail.pm b/IkiWiki/Plugin/trail.pm index cb94855fd..476db4dcb 100644 --- a/IkiWiki/Plugin/trail.pm +++ b/IkiWiki/Plugin/trail.pm @@ -319,10 +319,9 @@ sub prerender { } if (defined $pagestate{$trail}{trail}{sort}) { - # re-sort - @$members = pagespec_match_list($trail, 'internal(*)', - list => $members, - sort => $pagestate{$trail}{trail}{sort}); + @$members = IkiWiki::sort_pages( + $pagestate{$trail}{trail}{sort}, + $members); } if (IkiWiki::yesno $pagestate{$trail}{trail}{reverse}) { @@ -411,6 +410,8 @@ sub pagetemplate (@) { my $page = $params{page}; my $template = $params{template}; + return unless length $page; + if ($template->query(name => 'trails') && ! $recursive) { prerender();