gollum 2.2.6 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +8 -0
- data/gollum.gemspec +1 -1
- data/lib/gollum.rb +1 -1
- data/lib/gollum/frontend/app.rb +11 -3
- metadata +1 -1
data/README.md
CHANGED
|
@@ -413,6 +413,14 @@ By default, internal wiki links are all absolute from the root. To specify a dif
|
|
|
413
413
|
|
|
414
414
|
wiki = Gollum::Wiki.new("my-gollum-repo.git", :base_path => "/wiki")
|
|
415
415
|
|
|
416
|
+
Note that base_path just modifies the links. To map gollum to a non-root location, use `map` in config.ru. See [#532](https://github.com/github/gollum/issues/532).
|
|
417
|
+
|
|
418
|
+
> :base_path - String base path for all Wiki links.
|
|
419
|
+
>
|
|
420
|
+
> The String base path to prefix to internal links. For example, when set
|
|
421
|
+
> to "/wiki", the page "Hobbit" will be linked as "/wiki/Hobbit". Defaults
|
|
422
|
+
> to "/".
|
|
423
|
+
|
|
416
424
|
Get the latest version of the given human or canonical page name:
|
|
417
425
|
|
|
418
426
|
page = wiki.page('page-name')
|
data/gollum.gemspec
CHANGED
data/lib/gollum.rb
CHANGED
|
@@ -23,7 +23,7 @@ require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
|
|
|
23
23
|
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
|
|
24
24
|
|
|
25
25
|
module Gollum
|
|
26
|
-
VERSION = '2.2.
|
|
26
|
+
VERSION = '2.2.7'
|
|
27
27
|
|
|
28
28
|
def self.assets_path
|
|
29
29
|
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
|
data/lib/gollum/frontend/app.rb
CHANGED
|
@@ -86,7 +86,7 @@ module Precious
|
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
get '/' do
|
|
89
|
-
redirect File.join(settings.wiki_options[:base_path].to_s, 'Home')
|
|
89
|
+
redirect File.join(settings.wiki_options[:page_file_dir].to_s,settings.wiki_options[:base_path].to_s, 'Home')
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
# path is set to name if path is nil.
|
|
@@ -145,6 +145,7 @@ module Precious
|
|
|
145
145
|
page_name = CGI.unescape(params[:page])
|
|
146
146
|
wiki = wiki_new
|
|
147
147
|
page = wiki.paged(page_name, path, exact = true)
|
|
148
|
+
return if page.nil?
|
|
148
149
|
rename = params[:rename].to_url if params[:rename]
|
|
149
150
|
name = rename || page.name
|
|
150
151
|
committer = Gollum::Committer.new(wiki, commit_message)
|
|
@@ -190,13 +191,20 @@ module Precious
|
|
|
190
191
|
path = '' if path.nil?
|
|
191
192
|
format = params[:format].intern
|
|
192
193
|
|
|
194
|
+
page_dir = File.join(settings.wiki_options[:page_file_dir].to_s,
|
|
195
|
+
settings.wiki_options[:base_path].to_s)
|
|
196
|
+
# Home is a special case.
|
|
197
|
+
path = '' if name.downcase == 'home'
|
|
198
|
+
|
|
199
|
+
page_dir = File.join(page_dir, path)
|
|
200
|
+
|
|
193
201
|
# write_page is not directory aware so use wiki_options to emulate dir support.
|
|
194
|
-
wiki_options = settings.wiki_options.merge({ :page_file_dir =>
|
|
202
|
+
wiki_options = settings.wiki_options.merge({ :page_file_dir => page_dir })
|
|
195
203
|
wiki = Gollum::Wiki.new(settings.gollum_path, wiki_options)
|
|
196
204
|
|
|
197
205
|
begin
|
|
198
206
|
wiki.write_page(name, format, params[:content], commit_message)
|
|
199
|
-
redirect to("/#{clean_url(CGI.escape(::File.join(
|
|
207
|
+
redirect to("/#{clean_url(CGI.escape(::File.join(page_dir,name)))}")
|
|
200
208
|
rescue Gollum::DuplicatePageError => e
|
|
201
209
|
@message = "Duplicate page: #{e.message}"
|
|
202
210
|
mustache :error
|