diff --git a/lib/gollum/frontend/app.rb b/lib/gollum/frontend/app.rb index 82415c68..1ec7c85e 100644 --- a/lib/gollum/frontend/app.rb +++ b/lib/gollum/frontend/app.rb @@ -76,7 +76,7 @@ module Precious @name = params[:splat].first wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options) if page = wiki.page(@name) - if settings.wiki_options[:live_preview] && page.format.to_s.include?('markdown') && supported_useragent?(request.user_agent) + if wiki.live_preview && page.format.to_s.include?('markdown') && supported_useragent?(request.user_agent) redirect '/livepreview/index.html?page=' + encodeURIComponent(@name) else @page = page diff --git a/lib/gollum/wiki.rb b/lib/gollum/wiki.rb index c9c1308a..a77721ec 100644 --- a/lib/gollum/wiki.rb +++ b/lib/gollum/wiki.rb @@ -133,6 +133,9 @@ module Gollum # Gets the Array of chars to sub for ws in filenames. attr_reader :ws_subs + # Gets the boolean live preview value. + attr_reader :live_preview + # Public: Initialize a new Gollum Repo. # # path - The String path to the Git repository that holds the Gollum