Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ad743e4bd | |||
| fa97b57a96 |
@@ -413,7 +413,7 @@ By default, internal wiki links are all absolute from the root. To specify a dif
|
|||||||
|
|
||||||
wiki = Gollum::Wiki.new("my-gollum-repo.git", :base_path => "/wiki")
|
wiki = Gollum::Wiki.new("my-gollum-repo.git", :base_path => "/wiki")
|
||||||
|
|
||||||
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).
|
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). `bin/gollum` now includes a simple map based on base path.
|
||||||
|
|
||||||
> :base_path - String base path for all Wiki links.
|
> :base_path - String base path for all Wiki links.
|
||||||
>
|
>
|
||||||
|
|||||||
+27
-1
@@ -141,5 +141,31 @@ else
|
|||||||
require cfg
|
require cfg
|
||||||
end
|
end
|
||||||
|
|
||||||
Precious::App.run!(options)
|
base_path = wiki_options[:base_path]
|
||||||
|
|
||||||
|
if wiki_options[:base_path].nil?
|
||||||
|
Precious::App.run!(options)
|
||||||
|
else
|
||||||
|
require 'rack'
|
||||||
|
|
||||||
|
class MapGollum
|
||||||
|
def initialize base_path
|
||||||
|
@mg = Rack::Builder.new do
|
||||||
|
map '/' do
|
||||||
|
run Proc.new { [ 302, {'Location'=> "/#{base_path}" }, [] ] }
|
||||||
|
end
|
||||||
|
|
||||||
|
map "/#{base_path}" do
|
||||||
|
run Precious::App
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def call(env)
|
||||||
|
@mg.call(env)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
# Rack::Handler does not work with Ctrl + C. Use Rack::Server instead.
|
||||||
|
Rack::Server.new(:app => MapGollum.new(base_path), :Port => options['port']).start
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
|
|||||||
s.required_ruby_version = ">= 1.8.7"
|
s.required_ruby_version = ">= 1.8.7"
|
||||||
|
|
||||||
s.name = 'gollum'
|
s.name = 'gollum'
|
||||||
s.version = '2.2.7'
|
s.version = '2.2.8'
|
||||||
s.date = '2012-10-14'
|
s.date = '2012-10-14'
|
||||||
s.rubyforge_project = 'gollum'
|
s.rubyforge_project = 'gollum'
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
|
|||||||
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
|
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
|
||||||
|
|
||||||
module Gollum
|
module Gollum
|
||||||
VERSION = '2.2.7'
|
VERSION = '2.2.8'
|
||||||
|
|
||||||
def self.assets_path
|
def self.assets_path
|
||||||
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
|
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
|
||||||
|
|||||||
Reference in New Issue
Block a user