From a9b80b2f06580efa144a09da0f139759db180630 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 4 Jan 2016 16:21:53 -0800 Subject: [PATCH] features/layout_data: add scenario for inheriting layout data from child to parent Ref: https://github.com/jekyll/jekyll/pull/4312#discussion_r48781985 --- features/layout_data.feature | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/features/layout_data.feature b/features/layout_data.feature index a06502c8..78998665 100644 --- a/features/layout_data.feature +++ b/features/layout_data.feature @@ -16,3 +16,22 @@ Feature: Layout data 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" + + Scenario: Inherit custom layout data + Given I have a _layouts directory + And I have a "_layouts/custom.html" file with content: + """ + --- + layout: base + foo: my custom data + --- + {{ content }} + """ + And I have a "_layouts/base.html" file with content: + """ + {{ 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"