Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorRuben <ruben.nellen@gmail.com>2013-11-28 18:27:09 +0400
committerspf13 <steve.francia@gmail.com>2013-12-17 02:40:33 +0400
commitde670ced86e6df76278a19f19068bbeb46cc5d2f (patch)
tree496c668a94dad97bab66e772a5b9c9d8d6702cff /source
parent6da23f7449366e7699e406adb3334e71ffd1e70e (diff)
Fixes #141: Wrong section in multi level structure
Diffstat (limited to 'source')
-rw-r--r--source/filesystem.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/filesystem.go b/source/filesystem.go
index abec4bad4..f44f003f0 100644
--- 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
}