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:
+4
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user