Make pages inherit their sidebar/header/footer from parent directories regardless of the current 'page_file_dir' of the wiki. refs #413 (https://github.com/github/gollum/issues/413)

This commit is contained in:
Darren Oakley
2012-07-09 12:10:41 +01:00
parent 19325930a2
commit 50e494e8e9
4 changed files with 48 additions and 9 deletions
+4 -2
View File
@@ -434,7 +434,9 @@ module Gollum
end
# Loads a sub page. Sub page names (footers, headers, sidebars) are prefixed with
# an underscore to distinguish them from other Pages.
# an underscore to distinguish them from other Pages. If there is not one within
# the current directory, starts walking up the directory tree to try and find one
# within parent directories.
#
# name - String page name.
#
@@ -447,7 +449,7 @@ module Gollum
dirs = self.path.split('/')
dirs.pop
map = @wiki.tree_map_for(@wiki.ref)
map = @wiki.tree_map_for(@wiki.ref, true)
while !dirs.empty?
if page = find_page_in_tree(map, name, dirs.join('/'))
page.parent_page = self