Merge pull request #4388 from jekyll/fix-page.class-access

Merge pull request 4388
This commit is contained in:
jekyllbot 2016-01-22 13:01:04 -08:00
commit 512c7fdb05
2 changed files with 13 additions and 1 deletions

View File

@ -301,6 +301,18 @@ Feature: Post data
And the _site directory should exist
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
Given I have a _posts directory
And I have a _layouts directory

View File

@ -46,7 +46,7 @@ module Jekyll
def [](key)
if self.class.mutable? && @mutations.key?(key)
@mutations[key]
elsif respond_to? key
elsif self.class.invokable? key
public_send key
else
fallback_data[key]