Merge branch 'template_page' of https://github.com/QuaeNocentDocent/gollum into template_page
rebasing
This commit is contained in:
+10
@@ -145,6 +145,9 @@ MSG
|
|||||||
"If not specified, uses the '<git-repo>/mathjax.config.js' file.") do |file|
|
"If not specified, uses the '<git-repo>/mathjax.config.js' file.") do |file|
|
||||||
wiki_options[:mathjax_config] = file || 'mathjax.config.js'
|
wiki_options[:mathjax_config] = file || 'mathjax.config.js'
|
||||||
end
|
end
|
||||||
|
opts.on("--plantuml-url [URL]", "Sets the PlantUML server endpoint.") do |url|
|
||||||
|
wiki_options[:plantuml_url] = url
|
||||||
|
end
|
||||||
opts.on("--template-dir [PATH]", "Specify custom mustache template directory.") do |path|
|
opts.on("--template-dir [PATH]", "Specify custom mustache template directory.") do |path|
|
||||||
wiki_options[:template_dir] = path
|
wiki_options[:template_dir] = path
|
||||||
end
|
end
|
||||||
@@ -245,6 +248,13 @@ else
|
|||||||
require cfg
|
require cfg
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if wiki_options[:plantuml_url]
|
||||||
|
Gollum::Filter::PlantUML.configure do |config|
|
||||||
|
puts "Using #{wiki_options[:plantuml_url]} as PlantUML endpoint"
|
||||||
|
config.url = wiki_options[:plantuml_url]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
base_path = wiki_options[:base_path]
|
base_path = wiki_options[:base_path]
|
||||||
|
|
||||||
if base_path.nil?
|
if base_path.nil?
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ module Precious
|
|||||||
before do
|
before do
|
||||||
settings.wiki_options[:allow_editing] = settings.wiki_options.fetch(:allow_editing, true)
|
settings.wiki_options[:allow_editing] = settings.wiki_options.fetch(:allow_editing, true)
|
||||||
@allow_editing = settings.wiki_options[:allow_editing]
|
@allow_editing = settings.wiki_options[:allow_editing]
|
||||||
|
|
||||||
forbid unless @allow_editing || request.request_method == "GET"
|
forbid unless @allow_editing || request.request_method == "GET"
|
||||||
Precious::App.set(:mustache, {:templates => settings.wiki_options[:template_dir]}) if settings.wiki_options[:template_dir]
|
Precious::App.set(:mustache, {:templates => settings.wiki_options[:template_dir]}) if settings.wiki_options[:template_dir]
|
||||||
@base_url = url('/', false).chomp('/')
|
@base_url = url('/', false).chomp('/')
|
||||||
|
|||||||
Reference in New Issue
Block a user