2015-12-27 05:11:05 +11:00
|
|
|
Feature: Responsive image generation
|
|
|
|
As a Jekyll user
|
|
|
|
I want to generate responsive images
|
|
|
|
In order to use them on my pages
|
|
|
|
|
|
|
|
Scenario: Resizing images
|
|
|
|
Given I have a responsive_image configuration with:
|
|
|
|
"""
|
|
|
|
template: _includes/responsive-image.html
|
|
|
|
sizes:
|
|
|
|
- width: 100
|
|
|
|
"""
|
|
|
|
|
|
|
|
And I have a file "index.html" with "{% responsive_image path: assets/test.png alt: Foobar %}"
|
|
|
|
When I run Jekyll
|
|
|
|
Then the image "assets/resized/test-100x50.png" should have the dimensions "100x50"
|
|
|
|
|
|
|
|
Scenario: Handling subdirectories
|
|
|
|
Given I have a responsive_image configuration with:
|
|
|
|
"""
|
|
|
|
template: _includes/responsive-image.html
|
2015-12-28 09:41:04 +11:00
|
|
|
output_path_format: assets/resized/%{dirname}/%{filename}-%{width}.%{extension}
|
2015-12-27 05:11:05 +11:00
|
|
|
sizes:
|
|
|
|
- width: 100
|
|
|
|
"""
|
|
|
|
|
|
|
|
And I have a file "index.html" with:
|
|
|
|
"""
|
|
|
|
{% responsive_image path: assets/test.png %}
|
|
|
|
{% responsive_image path: assets/subdir/test.png %}
|
2016-06-06 07:30:45 +10:00
|
|
|
{% responsive_image path: assets/test.png cache: true %}
|
2015-12-27 05:11:05 +11:00
|
|
|
"""
|
|
|
|
|
|
|
|
When I run Jekyll
|
|
|
|
Then the file "assets/resized/test-100.png" should exist
|
2015-12-28 09:41:04 +11:00
|
|
|
And the file "assets/resized/subdir/test-100.png" should exist
|