Permalink
Browse files

Using default config if config passed is either empty or null

  • Loading branch information...
1 parent 3e1c171 commit 61bf2776f71eb9e8553cabfd57112b482abaeb93 @parkr parkr committed Jan 2, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/jekyll.rb
View
@@ -127,8 +127,10 @@ def self.configuration(override)
# then, we need to know where to look for _config.yml
source = override['source'] || Jekyll::DEFAULTS['source']
- # Get configuration from <source>/_config.yml
- config_file = override['config'] || File.join(source, '_config.yml')
+ # Get configuration from <source>/_config.yml or <source>/<config_file
+ config_file = override.delete('config')
+ config_file = File.join(source, "_config.yml") if config_file.to_s.empty?
+
begin
config = YAML.load_file(config_file)
raise "Invalid configuration - #{config_file}" if !config.is_a?(Hash)

0 comments on commit 61bf277

Please sign in to comment.