apply Liquid templating to includes

This commit is contained in:
Mikael Lind 2008-12-27 13:03:03 +01:00
parent e7b2df1156
commit 4f677f627e
1 changed files with 6 additions and 2 deletions

View File

@ -14,7 +14,11 @@ module Jekyll
Dir.chdir(File.join(Jekyll.source, '_includes')) do
choices = Dir['**/*'].reject { |x| File.symlink?(x) }
if choices.include?(@file)
File.read(@file)
source = File.read(@file)
partial = Liquid::Template.parse(source)
context.stack do
partial.render(context)
end
else
"Included file '#{@file}' not found in _includes directory"
end