natural sort (#474)

This commit is contained in:
Dawid 'DeyV' Polak authored and 1138-4EB committed 2018-07-29 17:43:23 +01:00
1 parent c6f60d298a
commit 202c9c97e5
3 files changed
+12 -1

No files matched your search

+2 -1
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