diff --git a/pwiki/page.js b/pwiki/page.js index 223b543..39979d2 100755 --- a/pwiki/page.js +++ b/pwiki/page.js @@ -2474,7 +2474,7 @@ module.System = {
Nested pages:
- + @source(./title)
diff --git a/pwiki/store/base.js b/pwiki/store/base.js index 3db813d..e19287b 100755 --- a/pwiki/store/base.js +++ b/pwiki/store/base.js @@ -897,6 +897,12 @@ module.BaseStore = { // actual existing pages, while in non-strict mode the pattern will // match all sub-paths. // + // Handled path arguments: + // all + // sort= + // sortnewlast (default) + // sortnewfirst + // __match_args__: { // // : function(value, args){ @@ -974,6 +980,11 @@ module.BaseStore = { var all = args.all var sort = args.sort + var newlast = + args.sortnewlast + ?? !(args.sortnewfirst + // default is sortnewlast... + ?? false) var test = await this.__match_args(args) args = pwpath.joinArgs('', args) @@ -1034,7 +1045,10 @@ module.BaseStore = { that .sort(this, ...sort.split(/\s*[,\s]+/g)) :this - .sortAs(order) }) + .sortAs(order, + newlast ? + 'head' + : 'tail') }) .map(function(p){ return p+args })} // direct search... diff --git a/pwiki2.js b/pwiki2.js index a34a8a0..748af91 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -37,9 +37,6 @@ * - * * -* XXX sort: for saved order, how do we handle items not in the metadata? -* ...there are three ways to handle this, put them first, last or -* add an option with a reasonable default... * XXX sort: revise how we store order... * .metadata.order = [ .. ] * .metadata.order_ = [ .. ]