Add feature test for layout data

Fixes issue defined here:
https://github.com/jekyll/jekyll/issues/4246#issuecomment-168367510
This commit is contained in:
Parker Moore 2016-01-04 12:10:05 -08:00
parent 06c45df8c3
commit 62d7f5ecad
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
Feature: Layout data
As a hacker who likes to avoid repetition
I want to be able to embed data into my layouts
In order to make the layouts slightly dynamic
Scenario: Use custom layout data
Given I have a _layouts directory
And I have a "_layouts/custom.html" file with content:
"""
---
foo: my custom data
---
{{ content }} foo: {{ layout.foo }}
"""
And I have an "index.html" page with layout "custom" that contains "page content"
When I run jekyll build
Then the "_site/index.html" file should exist
And I should see "page content\n foo: my custom data" in "_site/index.html"