Fix handling of top-level page bundles

Fixes #4332
This commit is contained in:
Bjørn Erik Pedersen
2018-01-27 18:03:06 +01:00
parent 83c761b71a
commit 4eb2fec67c
8 changed files with 75 additions and 40 deletions

View File

@@ -34,10 +34,15 @@ func TestFileInfo(t *testing.T) {
assert.Equal(filepath.FromSlash("/a/b/page.md"), f.Filename())
assert.Equal(filepath.FromSlash("b/"), f.Dir())
assert.Equal(filepath.FromSlash("b/page.md"), f.Path())
assert.Equal("b", f.Section())
}},
{filepath.FromSlash("/a/"), filepath.FromSlash("/a/b/c/d/page.md"), func(f *FileInfo) {
assert.Equal("b", f.Section())
}},
} {
f := s.NewFileInfo(this.base, this.filename, nil)
f := s.NewFileInfo(this.base, this.filename, false, nil)
this.assert(f)
}