From 4f677f627ef569be8896dab4b1b932196e71d6b4 Mon Sep 17 00:00:00 2001 From: Mikael Lind Date: Sat, 27 Dec 2008 13:03:03 +0100 Subject: [PATCH] apply Liquid templating to includes --- lib/jekyll/tags/include.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/tags/include.rb b/lib/jekyll/tags/include.rb index f2494243..840f36bd 100644 --- a/lib/jekyll/tags/include.rb +++ b/lib/jekyll/tags/include.rb @@ -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 @@ -24,4 +28,4 @@ module Jekyll end -Liquid::Template.register_tag('include', Jekyll::IncludeTag) \ No newline at end of file +Liquid::Template.register_tag('include', Jekyll::IncludeTag)