mirror of
https://github.com/wildlyinaccurate/jekyll-responsive-image.git
synced 2025-07-04 00:00:41 -04:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
959f5abdc0 | ||
|
f49726affc | ||
|
682beff7b5 |
@ -13,6 +13,20 @@ Feature: Jekyll responsive_image_block tag
|
||||
When I run Jekyll
|
||||
Then I should see "<img alt=\"Lorem ipsum\" src=\"/assets/everybody-loves-jalapeño-pineapple-cornbread.png\" title=\"Magic rainbow adventure!\"" in "_site/index.html"
|
||||
|
||||
Scenario: Tabs for indentation
|
||||
Given I have a responsive_image configuration with "template" set to "_includes/responsive-image.html"
|
||||
And I have a file "index.html" with:
|
||||
"""
|
||||
{% assign path = 'assets/everybody-loves-jalapeño-pineapple-cornbread.png' %}
|
||||
{% responsive_image_block %}
|
||||
path: {{ path }}
|
||||
title: Magic rainbow adventure!
|
||||
alt: Lorem ipsum
|
||||
{% endresponsive_image_block %}
|
||||
"""
|
||||
When I run Jekyll
|
||||
Then I should see "<img alt=\"Lorem ipsum\" src=\"/assets/everybody-loves-jalapeño-pineapple-cornbread.png\" title=\"Magic rainbow adventure!\"" in "_site/index.html"
|
||||
|
||||
Scenario: Global variables available in templates
|
||||
Given I have a file "index.html" with:
|
||||
"""
|
||||
|
@ -4,7 +4,13 @@ module Jekyll
|
||||
include Jekyll::ResponsiveImage::Utils
|
||||
|
||||
def render(context)
|
||||
attributes = YAML.load(super)
|
||||
content = super
|
||||
|
||||
if content.include?("\t")
|
||||
content = content.lines.map {|line| line.gsub(/\G[\t ]/, " ")}.join("\n")
|
||||
end
|
||||
|
||||
attributes = YAML.load(content)
|
||||
Renderer.new(context.registers[:site], attributes).render_responsive_image
|
||||
end
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
module Jekyll
|
||||
module ResponsiveImage
|
||||
VERSION = '1.5.3'.freeze
|
||||
VERSION = '1.5.5'.freeze
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user