natural sort (#474)

Former-commit-id: 9865271f38824fd4762253014a7855ee087d315f [formerly 17c1a5f7e2cbbea4f01ba394f6ae76ded22594f3] [formerly 2087a30cb8fa514b33d99fb9797a0751a8f532cd [formerly 202c9c97e5]]
Former-commit-id: 513ed21a74e590d062f0974b0ea7af7381162df9 [formerly 3fb2617b7aa05abe93460e2ab25ba2369ce68095]
Former-commit-id: a038eda5003c044eeceeea46539f3673ebc16f95
This commit is contained in:
Dawid 'DeyV' Polak
2018-07-29 13:22:11 +02:00
committed by 1138-4EB
parent bdfca1be33
commit 5e58c25aa4
3 changed files with 12 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ import (
"time"
"github.com/gohugoio/hugo/parser"
"github.com/maruel/natural"
)
// File contains the information about a particular file or directory.
@@ -372,7 +373,7 @@ func (l byName) Less(i, j int) bool {
return false
}
return strings.ToLower(l.Items[i].Name) < strings.ToLower(l.Items[j].Name)
return natural.Less(l.Items[i].Name, l.Items[j].Name)
}
// By Size