This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-site.git


The following commit(s) were added to refs/heads/master by this push:
     new 21ade42  SLING-7979 - fix isAncestor logic, parent must be a folder
21ade42 is described below

commit 21ade42727b4cfb748f62b5e41991e41016ff1a8
Author: Bertrand Delacretaz <[email protected]>
AuthorDate: Thu Oct 4 19:07:33 2018 +0200

    SLING-7979 - fix isAncestor logic, parent must be a folder
---
 src/main/jbake/templates/includes/U.groovy | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/jbake/templates/includes/U.groovy 
b/src/main/jbake/templates/includes/U.groovy
index 62ccb43..18780cf 100644
--- a/src/main/jbake/templates/includes/U.groovy
+++ b/src/main/jbake/templates/includes/U.groovy
@@ -41,7 +41,7 @@ class U {
     // Is parent an ancestor of child?
     def isAncestor(parent, child) {
        // assuming .html extension
-       return child.uri[0..-6].contains(parent.uri[0..-6]) && 
!child.uri.equals(parent.uri)
+        return child.uri[0..-6].contains(parent.uri[0..-6] + '/') && 
!child.uri.equals(parent.uri)
     }
 
     // Return the parents of supplied content, sorted by

Reply via email to