mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-12-04 19:08:22 +01:00
Fix post ordering by Weight, reversed Date and FilePath.
This commit is contained in:
parent
4b23a11d0b
commit
5592026db7
13
dir.go
13
dir.go
@ -262,8 +262,17 @@ func (d *Dir) write(dstDir string, task *Task) error {
|
||||
func (d *Dir) sort() {
|
||||
sort.Slice(d.Pages, func(i, j int) bool {
|
||||
pi, pj := d.Pages[i], d.Pages[j]
|
||||
return pi.Weight < pj.Weight || pi.Date.After(pj.Date) ||
|
||||
pi.FilePath < pj.FilePath
|
||||
return pi.FilePath < pj.FilePath
|
||||
})
|
||||
|
||||
sort.SliceStable(d.Pages, func(i, j int) bool {
|
||||
pi, pj := d.Pages[i], d.Pages[j]
|
||||
return pi.Date.After(pj.Date)
|
||||
})
|
||||
|
||||
sort.SliceStable(d.Pages, func(i, j int) bool {
|
||||
pi, pj := d.Pages[i], d.Pages[j]
|
||||
return pi.Weight < pj.Weight
|
||||
})
|
||||
|
||||
for i := range d.Pages {
|
||||
|
Loading…
Reference in New Issue
Block a user