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/d14f7864 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/d14f7864 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/d14f7864 Branch: refs/heads/master Commit: d14f7864b0390cc339f414c549d166dee5b8a346 Parents: d8eb137 Author: Richard Downer <[email protected]> Authored: Wed Apr 20 16:13:07 2016 +0100 Committer: Richard Downer <[email protected]> Committed: Wed Apr 20 16:28:18 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/d14f7864/_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
