Fix child page inclusion on publish build When building the website the child page inclusions did not work due to path confusion. This commit fixes it.
Reviewed by Duncan Godwin. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/e7ef6802 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/e7ef6802 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/e7ef6802 Branch: refs/heads/0.9.0 Commit: e7ef6802a3b1e154f20e4f912cdbd2dd94608a66 Parents: 80d6429 Author: Richard Downer <[email protected]> Authored: Wed Apr 20 16:13:07 2016 +0100 Committer: Richard Downer <[email protected]> Committed: Wed Apr 20 16:13:07 2016 +0100 ---------------------------------------------------------------------- _plugins/page_structure.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/e7ef6802/_plugins/page_structure.rb ---------------------------------------------------------------------- diff --git a/_plugins/page_structure.rb b/_plugins/page_structure.rb index b1697bd..cb81c93 100644 --- a/_plugins/page_structure.rb +++ b/_plugins/page_structure.rb @@ -7,6 +7,7 @@ require 'rubygems' require 'yaml' require "kramdown" +require 'pathname' module PageStructureUtils @@ -105,7 +106,7 @@ module PageStructureUtils # def self.parseChildYAMLFromParent(page) # get the base directory of the current file - $baseFile = Dir.pwd+page['dir'] + $baseFile = Dir.pwd+"/"+(Pathname(page['path']).dirname.to_s) # list all of the files in that directory $listings = Dir[$baseFile+"/*.md"] $allPages = [] @@ -143,7 +144,7 @@ module PageStructureUtils # def self.parseChildPagesFromParent(page) # get the base directory of the current file - $baseFile = Dir.pwd+page['dir'] + $baseFile = Dir.pwd+"/"+(Pathname(page['path']).dirname.to_s) # list all of the files in that directory $listings = Dir[$baseFile+"/*"] # filter by the key pattern
