mirror of
https://github.com/gohugoio/hugo.git
synced 2025-02-18 15:22:28 +00:00
parent
40efc8677a
commit
c1a2b7a102
1 changed files with 1 additions and 2 deletions
|
@ -15,7 +15,6 @@ package hugolib
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var spc = newPageCache()
|
var spc = newPageCache()
|
||||||
|
@ -44,7 +43,7 @@ func (by PageBy) Sort(pages Pages) {
|
||||||
var DefaultPageSort = func(p1, p2 *Page) bool {
|
var DefaultPageSort = func(p1, p2 *Page) bool {
|
||||||
if p1.Weight == p2.Weight {
|
if p1.Weight == p2.Weight {
|
||||||
if p1.Date.Unix() == p2.Date.Unix() {
|
if p1.Date.Unix() == p2.Date.Unix() {
|
||||||
return strings.Compare(p1.LinkTitle(), p2.LinkTitle()) == -1
|
return (p1.LinkTitle() < p2.LinkTitle())
|
||||||
}
|
}
|
||||||
return p1.Date.Unix() > p2.Date.Unix()
|
return p1.Date.Unix() > p2.Date.Unix()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue