mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-25 21:41:30 +00:00
Use filepath as the last default sort key for pages
This commit is contained in:
parent
7708d4556d
commit
dcd9c69aa8
1 changed files with 3 additions and 0 deletions
|
@ -43,6 +43,9 @@ 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() {
|
||||||
|
if p1.LinkTitle() == p2.LinkTitle() {
|
||||||
|
return (p1.FullFilePath() < p2.FullFilePath())
|
||||||
|
}
|
||||||
return (p1.LinkTitle() < p2.LinkTitle())
|
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