summaryrefslogtreecommitdiffstats
path: root/hugolib/content_map.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/content_map.go')
-rw-r--r--hugolib/content_map.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/hugolib/content_map.go b/hugolib/content_map.go
index a7f344004..9abf0d5b0 100644
--- a/hugolib/content_map.go
+++ b/hugolib/content_map.go
@@ -680,7 +680,14 @@ func (m *contentMap) splitKey(k string) []string {
return nil
}
- return strings.Split(k, "/")[1:]
+ parts := strings.Split(k, "/")[1:]
+ if len(parts) == 0 {
+ return nil
+ }
+ if parts[len(parts)-1] == "" {
+ parts = parts[:len(parts)-1]
+ }
+ return parts
}
func (m *contentMap) testDump() string {