This commit is contained in:
parent
938e597f3f
commit
dfc932b7b0
@ -16,6 +16,10 @@ import (
|
||||
|
||||
// ReadContentDir walks through content directory and builds the tree of configurations
|
||||
func (node *TreeNode) ReadContentDir(inBase string, outBase string, dir string, conf *PathConfig) {
|
||||
if node.root == nil {
|
||||
// first node is root
|
||||
node.root = node
|
||||
}
|
||||
node.fillConfig(inBase, outBase, dir, conf)
|
||||
|
||||
files, err := ioutil.ReadDir(node.InputPath)
|
||||
@ -51,6 +55,7 @@ func (node *TreeNode) ReadContentDir(inBase string, outBase string, dir string,
|
||||
if f.IsDir() {
|
||||
helper.Log.Debugf("DIR %s", p)
|
||||
newTree := new(TreeNode)
|
||||
newTree.root = node.root
|
||||
if node.Sub == nil {
|
||||
node.Sub = make([]*TreeNode, 0)
|
||||
}
|
||||
|
@ -154,10 +154,6 @@ func (node *TreeNode) handleCollections() {
|
||||
}
|
||||
|
||||
func (node *TreeNode) fillConfig(inBase, outBase, dir string, conf *PathConfig) {
|
||||
if node.root == nil {
|
||||
// this must be root
|
||||
node.root = node
|
||||
}
|
||||
inPath := inBase
|
||||
if dir != "" {
|
||||
inPath += "/" + dir
|
||||
@ -229,6 +225,7 @@ func (node *TreeNode) fillConfig(inBase, outBase, dir string, conf *PathConfig)
|
||||
|
||||
func Add2Nav(currentNode *TreeNode, pathConfig *PathConfig, tplFilename, outDir string, navname string, ctx interface{}, dataMapKey string, body string, hidden bool) {
|
||||
newNode := new(TreeNode)
|
||||
newNode.root = currentNode.root
|
||||
newNode.fillConfig(
|
||||
currentNode.InputPath,
|
||||
currentNode.OutputPath,
|
||||
|
Loading…
Reference in New Issue
Block a user