diff --git a/reference.go b/reference.go index ba5730c..89c0a3a 100644 --- a/reference.go +++ b/reference.go @@ -148,7 +148,7 @@ type namedNode struct { func contained(n node) []namedNode { switch n := n.(type) { case *group: - return authored(n.children) + return named(n.children) case *choice: out := make([]namedNode, len(n.items)) for i, it := range n.items { @@ -164,7 +164,8 @@ func contained(n node) []namedNode { // named skips a bound {..path} key: it is a render edge, not containment, so using // it as a path segment would report a node under a path that does not reach it. Only -// a template's fields hold bindings, so group children go through authored. +// a template's fields hold bindings — loadDir rejects a category or folder carrying +// the prefix — so this one skip serves a group's children too. func named(m map[string]node) []namedNode { out := make([]namedNode, 0, len(m)) for _, name := range sortedNames(m) { @@ -176,14 +177,6 @@ func named(m map[string]node) []namedNode { return out } -func authored(m map[string]node) []namedNode { - out := make([]namedNode, 0, len(m)) - for _, name := range sortedNames(m) { - out = append(out, namedNode{name: name, node: m[name]}) - } - return out -} - func sortedNames(m map[string]node) []string { names := make([]string, 0, len(m)) for name := range m {