mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-10-30 01:13:08 +00:00
Fix post ordering by Weight, reversed Date and FilePath.
This commit is contained in:
parent
820ab25a26
commit
3667c41c57
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 a new issue