]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
responses in halfhearted defense of provider in questions
[ikiwiki.git] / IkiWiki.pm
index e5da04a3bb86d8aa47d96cac3df679623ad707ee..49ac9719658496953dc5f32c920e27ee5ba9d20c 100644 (file)
@@ -1819,7 +1819,8 @@ sub loadindex () {
                        open ($in, "<", "$config{wikistatedir}/indexdb") || return;
                }
                else {
-                       $config{gettime}=1; # first build
+                       # gettime on first build
+                       $config{gettime}=1 unless defined $config{gettime};
                        return;
                }
        }
@@ -2459,6 +2460,19 @@ sub pagespec_match ($$;@) {
        return $sub->($page, @params);
 }
 
+# e.g. @pages = sort_pages("title", \@pages, reverse => "yes")
+#
+# Not exported yet, but could be in future if it is generally useful.
+# Note that this signature is not the same as IkiWiki::SortSpec::sort_pages,
+# which is "more internal".
+sub sort_pages ($$;@) {
+       my $sort = shift;
+       my $list = shift;
+       my %params = @_;
+       $sort = sortspec_translate($sort, $params{reverse});
+       return IkiWiki::SortSpec::sort_pages($sort, @$list);
+}
+
 sub pagespec_match_list ($$;@) {
        my $page=shift;
        my $pagespec=shift;