allow setting --url <custom_site_url> from commandline (issue #15, closes #143)

Sometimes you may be forced to use absolute urls. For example I had problem with FeedBurner's blog post preview page. Image links specified as relative urls were not resolved correctly. I can imagine some poor RSS readers may behave similar way.

I wanted site.url to be configurable, because I didn't want to hard-code final url there. I still want to be able to have working link when doing local web site development and testing. I have small bash script which runs jekyll -serve --auto with this parameter set for local development. My setup is more complicated, because I use several jekylls behind reverse proxy to simulate setup on http://binaryage.com which uses gh-pages from many repos together with layouts linked as git modules.
This commit is contained in:
Antonin Hildebrand 2010-03-21 01:16:07 +01:00
parent 6932a40d17
commit 23d26c5525
1 changed files with 4 additions and 0 deletions

View File

@ -78,6 +78,10 @@ opts = OptionParser.new do |opts|
end
end
opts.on("--url [URL]", "Set custom site.url") do |url|
options['url'] = url
end
opts.on("--version", "Display current version") do
puts "Jekyll " + Jekyll::VERSION
exit 0