summaryrefslogtreecommitdiffstats
path: root/hugolib/page__tree.go
diff options
context:
space:
mode:
authorTakayama Fumihiko <tekezo@pqrs.org>2020-04-23 23:59:17 +0900
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-04-23 18:12:13 +0200
commit27a4c4410cd9592249925fb14b32605fb961c597 (patch)
treef5bbfea23e2071e6028993cdfb103b60d6dab92f /hugolib/page__tree.go
parentade27699e5e51a61c8d90372181cae38313ae2cb (diff)
Fix IsAncestor and IsDescendant under subsection
Diffstat (limited to 'hugolib/page__tree.go')
-rw-r--r--hugolib/page__tree.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/hugolib/page__tree.go b/hugolib/page__tree.go
index 08a4680b7..bb28f1181 100644
--- a/hugolib/page__tree.go
+++ b/hugolib/page__tree.go
@@ -54,8 +54,8 @@ func (pt pageTree) IsAncestor(other interface{}) (bool, error) {
return false, nil
}
- if ref2.isSection() {
- return strings.HasPrefix(ref2.key, ref1.key+"/"), nil
+ if strings.HasPrefix(ref2.key, ref1.key+"/") {
+ return true, nil
}
return strings.HasPrefix(ref2.key, ref1.key+cmBranchSeparator), nil
@@ -101,8 +101,8 @@ func (pt pageTree) IsDescendant(other interface{}) (bool, error) {
return false, nil
}
- if ref1.isSection() {
- return strings.HasPrefix(ref1.key, ref2.key+"/"), nil
+ if strings.HasPrefix(ref1.key, ref2.key+"/") {
+ return true, nil
}
return strings.HasPrefix(ref1.key, ref2.key+cmBranchSeparator), nil