natural sort (#474)
This commit is contained in:
parent
c6f60d298a
commit
202c9c97e5
|
@ -214,6 +214,12 @@
|
|||
revision = "c3beff4c2358b44d0493c7dda585e7db7ff28ae6"
|
||||
version = "v1.7.6"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/maruel/natural"
|
||||
packages = ["."]
|
||||
revision = "dbcb3e2e8cf10eb839718ba666ef1e21b1c8b847"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/mholt/archiver"
|
||||
packages = ["."]
|
||||
|
|
|
@ -61,6 +61,10 @@
|
|||
name = "gopkg.in/natefinch/lumberjack.v2"
|
||||
version = "2.1.0"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/maruel/natural"
|
||||
|
||||
[[override]]
|
||||
name = "github.com/russross/blackfriday"
|
||||
version = "^1.0.0"
|
||||
|
|
3
file.go
3
file.go
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue