diff --git a/README.md b/README.md index 5523d98f..cd9a1efd 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,7 @@ Gollum comes with the following command line options: | --template-dir | [PATH] | Specify custom mustache template directory. | | --help | none | Display the list of options on the command line. | | --version | none | Display the current version of Gollum. | +| --template-page | none | Tell Gollum to use /_Template as the default content for new pages. _Template must be git committed. | **Notes:** diff --git a/bin/gollum b/bin/gollum index db8e714a..6d7cf46e 100755 --- a/bin/gollum +++ b/bin/gollum @@ -151,7 +151,9 @@ MSG opts.on("--template-dir [PATH]", "Specify custom mustache template directory.") do |path| wiki_options[:template_dir] = path end - + opts.on("--template-page", "Use _Template in root as a template for new pages.") do + wiki_options[:template_page] = true + end opts.separator "" opts.separator " Common:" diff --git a/lib/gollum/app.rb b/lib/gollum/app.rb index 0896a79f..730d9c62 100644 --- a/lib/gollum/app.rb +++ b/lib/gollum/app.rb @@ -104,6 +104,7 @@ module Precious @css = settings.wiki_options[:css] @js = settings.wiki_options[:js] @mathjax_config = settings.wiki_options[:mathjax_config] + @template_page=wiki_page("/_Template").page.raw_data if settings.wiki_options[:template_page] end get '/' do diff --git a/lib/gollum/views/create.rb b/lib/gollum/views/create.rb index d976df83..5973d6a0 100755 --- a/lib/gollum/views/create.rb +++ b/lib/gollum/views/create.rb @@ -56,6 +56,11 @@ module Precious def default_markup Precious::App.settings.default_markup end + + #QND - sets default template page if specified + def content + @template_page + end end end end