Add Page.FirstSection

It was added and then removed by accident some time ago. Let us add it again, as it is useful.
This commit is contained in:
Bjørn Erik Pedersen
2018-07-23 20:19:32 +02:00
parent c6b599a06d
commit 016dd4a69a
2 changed files with 25 additions and 0 deletions

View File

@@ -176,6 +176,7 @@ PAG|{{ .Title }}|{{ $sect.InSection . }}
active, err := home.InSection(home)
assert.NoError(err)
assert.True(active)
assert.Equal(p, p.FirstSection())
}},
{"l1", func(p *Page) {
assert.Equal("L1s", p.title)
@@ -249,6 +250,7 @@ PAG|{{ .Title }}|{{ $sect.InSection . }}
isAncestor, err = p.IsAncestor(l1)
assert.NoError(err)
assert.False(isAncestor)
assert.Equal(l1, p.FirstSection())
}},
{"perm a,link", func(p *Page) {