diff options
author | Takayama Fumihiko <[email protected]> | 2020-04-23 23:59:17 +0900 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2020-04-23 18:12:13 +0200 |
commit | 27a4c4410cd9592249925fb14b32605fb961c597 (patch) | |
tree | f5bbfea23e2071e6028993cdfb103b60d6dab92f /hugolib/page__tree.go | |
parent | ade27699e5e51a61c8d90372181cae38313ae2cb (diff) | |
download | hugo-27a4c4410cd9592249925fb14b32605fb961c597.tar.gz hugo-27a4c4410cd9592249925fb14b32605fb961c597.zip |
Fix IsAncestor and IsDescendant under subsection
Diffstat (limited to 'hugolib/page__tree.go')
-rw-r--r-- | hugolib/page__tree.go | 8 |
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 |