Make the layouts: config key relative to CWD or to Source

Fixes #1576.
This commit is contained in:
Parker Moore 2014-02-16 22:42:38 -05:00
parent 84471ba202
commit 47babef79a
1 changed files with 16 additions and 1 deletions

View File

@ -34,7 +34,22 @@ module Jekyll
end end
def layout_directory def layout_directory
File.join(site.source, site.config['layouts']) @layout_directory = (layout_directory_in_cwd || layout_directory_inside_source)
end
def layout_directory_inside_source
# TODO: Fix for Windows
File.join(site.source, File.expand_path(site.config['layouts'], "/"))
end
def layout_directory_in_cwd
# TODO: Fix on Windows
dir = File.join(Dir.pwd, File.expand_path(site.config['layouts'], '/'))
if Directory.exists?(dir)
dir
else
nil
end
end end
end end
end end