projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6da23f7
)
Fixes #141: Wrong section in multi level structure
author
Ruben
<ruben.nellen@gmail.com>
Thu, 28 Nov 2013 14:27:09 +0000
(15:27 +0100)
committer
spf13
<steve.francia@gmail.com>
Mon, 16 Dec 2013 22:40:33 +0000
(17:40 -0500)
source/filesystem.go
patch
|
blob
|
history
diff --git
a/source/filesystem.go
b/source/filesystem.go
index abec4bad4862100a0d1daf45952157e66ff41910..f44f003f08fd549f4a68ca932d389a0a48afee1e 100644
(file)
--- a/
source/filesystem.go
+++ b/
source/filesystem.go
@@
-6,6
+6,7
@@
import (
"os"
"path"
"path/filepath"
+ "strings"
)
type Input interface {
@@
-41,8
+42,11
@@
func (f *Filesystem) add(name string, reader io.Reader) (err error) {
return err
}
+ // section should be the first part of the path
dir, logical := path.Split(name)
- _, section := path.Split(path.Dir(name))
+ parts := strings.Split(dir, "/")
+ section := parts[0]
+
if section == "." {
section = ""
}
@@
-54,6
+58,7
@@
func (f *Filesystem) add(name string, reader io.Reader) (err error) {
Section: section,
Dir: dir,
})
+
return
}