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 -5
View File
@@ -126,7 +126,7 @@ module Precious
redirect "/#{page.escaped_url_path}"
end
get '/create/*' do
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
@name = params[:splat].first
@@ -136,7 +136,7 @@ module Precious
mustache :create
end
end
post '/create' do
name = params[:page]
path = sanitize_empty_params(params[:path])
@@ -294,9 +294,8 @@ module Precious
def show_page_or_file(fullpath)
path = extract_path(fullpath)
name = extract_name(fullpath)
# This breaks headers, footers, and sidebars.
# wiki_options = settings.wiki_options.merge({ :page_file_dir => path })
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
wiki_options = settings.wiki_options.merge({ :page_file_dir => path })
wiki = Gollum::Wiki.new(settings.gollum_path, wiki_options)
if page = wiki.page(name)
@page = page