ref: 065928fcf017b0ce6977fef666f7977f7f09b4d7
parent: 34ac562ce4544cb481d286e3aa040f5ca14afc04
author: spf13 <[email protected]>
date: Sat Dec 28 07:56:12 EST 2013
Adding page sorting by weight function (the default)
--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -121,6 +121,11 @@
}
}
+func (p Pages) ByWeight() Pages {
+ PageBy(DefaultPageSort).Sort(p)
+ return p
+}
+
func (p Pages) ByDate() Pages {
date := func(p1, p2 *Page) bool {
return p1.Date.Unix() < p2.Date.Unix()