From b442fe916e58dc4feeb17fe9a22e456b4c0a2018 Mon Sep 17 00:00:00 2001 From: Joseph Wynn Date: Sat, 6 Dec 2014 20:46:39 +0000 Subject: [PATCH] Don't pollute @attributes unnecessarily --- lib/jekyll/responsive_image/tag.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/responsive_image/tag.rb b/lib/jekyll/responsive_image/tag.rb index 0d2cfd8..8d41bf3 100644 --- a/lib/jekyll/responsive_image/tag.rb +++ b/lib/jekyll/responsive_image/tag.rb @@ -83,9 +83,10 @@ module Jekyll img = Magick::Image::read(@attributes['path']).first @attributes['original'] = image_hash(@attributes['path'], img.columns, img.rows) @attributes['resized'] = resize_image(img, config) - @attributes['template'] ||= config['template'] - partial = File.read(@attributes['template']) + image_template = @attributes['template'] || config['template'] + + partial = File.read(image_template) template = Liquid::Template.parse(partial) template.render!(@attributes)