]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/trail.pm
No longer using ikiwiki
[git.ikiwiki.info.git] / IkiWiki / Plugin / trail.pm
index cb94855fdd1181cb8113001f838db491db0bcc4d..476db4dcb90130ce895c9480300ac84e12c482b1 100644 (file)
@@ -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();