Merge pull request #4388 from jekyll/fix-page.class-access
Merge pull request 4388
This commit is contained in:
commit
512c7fdb05
|
@ -301,6 +301,18 @@ Feature: Post data
|
||||||
And the _site directory should exist
|
And the _site directory should exist
|
||||||
And I should see "Post author: Darth Vader" in "_site/2009/03/27/star-wars.html"
|
And I should see "Post author: Darth Vader" in "_site/2009/03/27/star-wars.html"
|
||||||
|
|
||||||
|
Scenario: Use a variable which is a reserved keyword in Ruby
|
||||||
|
Given I have a _posts directory
|
||||||
|
And I have a _layouts directory
|
||||||
|
And I have the following post:
|
||||||
|
| title | date | layout | class | content |
|
||||||
|
| My post | 2016-01-21 | simple | kewl-post | Luke, I am your father. |
|
||||||
|
And I have a simple layout that contains "{{page.title}} has class {{page.class}}"
|
||||||
|
When I run jekyll build
|
||||||
|
Then I should get a zero exit status
|
||||||
|
And the _site directory should exist
|
||||||
|
And I should see "My post has class kewl-post" in "_site/2016/01/21/my-post.html"
|
||||||
|
|
||||||
Scenario: Previous and next posts title
|
Scenario: Previous and next posts title
|
||||||
Given I have a _posts directory
|
Given I have a _posts directory
|
||||||
And I have a _layouts directory
|
And I have a _layouts directory
|
||||||
|
|
|
@ -46,7 +46,7 @@ module Jekyll
|
||||||
def [](key)
|
def [](key)
|
||||||
if self.class.mutable? && @mutations.key?(key)
|
if self.class.mutable? && @mutations.key?(key)
|
||||||
@mutations[key]
|
@mutations[key]
|
||||||
elsif respond_to? key
|
elsif self.class.invokable? key
|
||||||
public_send key
|
public_send key
|
||||||
else
|
else
|
||||||
fallback_data[key]
|
fallback_data[key]
|
||||||
|
|
Loading…
Reference in New Issue