Skip to content
Browse files

Using default config if config passed is either empty or null

  • Loading branch information...
1 parent 19a1198 commit 2f11cf3201cb7f332b10a66d7df4cf46ad3c1985 @parkr parkr committed Jan 1, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/jekyll.rb
View
6 lib/jekyll.rb
@@ -129,8 +129,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.safe_load_file(config_file)
raise "Configuration file: (INVALID) #{config_file}" if !config.is_a?(Hash)

0 comments on commit 2f11cf3

Please sign in to comment.
Something went wrong with that request. Please try again.