mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-10-30 09:23:09 +00:00
dir: Sort pages by date in reverse order
This commit is contained in:
parent
2b5f585ce2
commit
2e5ed347ea
2
dir.go
2
dir.go
|
@ -262,7 +262,7 @@ func (d *Dir) write(dstDir string, task *Task) error {
|
||||||
func (d *Dir) sort() {
|
func (d *Dir) sort() {
|
||||||
sort.Slice(d.Pages, func(i, j int) bool {
|
sort.Slice(d.Pages, func(i, j int) bool {
|
||||||
pi, pj := d.Pages[i], d.Pages[j]
|
pi, pj := d.Pages[i], d.Pages[j]
|
||||||
return pi.Weight < pj.Weight || pi.Date.Before(pj.Date) ||
|
return pi.Weight < pj.Weight || pi.Date.After(pj.Date) ||
|
||||||
pi.FilePath < pj.FilePath
|
pi.FilePath < pj.FilePath
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue