projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
34ac562
)
Adding page sorting by weight function (the default)
author
spf13
<steve.francia@gmail.com>
Sat, 28 Dec 2013 17:56:12 +0000
(12:56 -0500)
committer
spf13
<steve.francia@gmail.com>
Sat, 28 Dec 2013 17:56:12 +0000
(12:56 -0500)
hugolib/page.go
patch
|
blob
|
history
diff --git
a/hugolib/page.go
b/hugolib/page.go
index 8856c43d9621c9f4e3ea322d67655971c811f1eb..dcd93a964ef10cd373a19910517b587ff83e0713 100644
(file)
--- a/
hugolib/page.go
+++ b/
hugolib/page.go
@@
-121,6
+121,11
@@
func (p Pages) Limit(n int) Pages {
}
}
+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()