Skip to content

Commit 4a8fc1f

Browse files
committed
Adding baseurl option. Fixes #51
1 parent d53ea4a commit 4a8fc1f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/jekyll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ opts = OptionParser.new do |opts|
4040
options['server_port'] = port unless port.nil?
4141
end
4242

43+
opts.on("--baseurl [BASE_URL]", "Serve website from a given base URL (default '/'") do |baseurl|
44+
options['baseurl'] = baseurl
45+
end
46+
4347
opts.on("--lsi", "Use LSI for better related posts") do
4448
options['lsi'] = true
4549
end
@@ -177,9 +181,9 @@ if options['server']
177181

178182
s = HTTPServer.new(
179183
:Port => options['server_port'],
180-
:DocumentRoot => destination,
181184
:MimeTypes => mime_types
182185
)
186+
s.mount(options['baseurl'], HTTPServlet::FileHandler, destination)
183187
t = Thread.new {
184188
s.start
185189
}

0 commit comments

Comments
 (0)