Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

support added for the --config [file] option

  • Loading branch information...
commit 6b5eceb2e956170b2be0e8540954a0e9ef5ecc53 1 parent 7d88f72
@bfontaine bfontaine authored
Showing with 9 additions and 2 deletions.
  1. +4 −0 bin/jekyll
  2. +5 −2 lib/jekyll.rb
View
4 bin/jekyll
@@ -50,6 +50,10 @@ opts = OptionParser.new do |opts|
end
+ opts.on("--config [FILE]", "Configuration file to use") do |config_file|
+ options['config_file'] = config_file
+ end
+
opts.on("--[no-]safe", "Safe mode (default unsafe)") do |safe|
options['safe'] = safe
end
View
7 lib/jekyll.rb
@@ -60,6 +60,8 @@ module Jekyll
'destination' => File.join(Dir.pwd, '_site'),
'plugins' => File.join(Dir.pwd, '_plugins'),
+ 'config_file' => '_config.yml',
+
'future' => true,
'lsi' => false,
'pygments' => false,
@@ -118,9 +120,10 @@ def self.configuration(override)
# _config.yml may override default source location, but until
# then, we need to know where to look for _config.yml
source = override['source'] || Jekyll::DEFAULTS['source']
+ config_filename = override['config_file'] || Jekyll::DEFAULTS['config_file']
- # Get configuration from <source>/_config.yml
- config_file = File.join(source, '_config.yml')
+ # Get configuration from <source>/<config_filename>
+ config_file = File.join(source, config_filename)
begin
config = YAML.load_file(config_file)
raise "Invalid configuration - #{config_file}" if !config.is_a?(Hash)
Please sign in to comment.
Something went wrong with that request. Please try again.