Fix code to allow dots in variables

This commit is contained in:
maul.esel 2013-09-02 15:17:28 +02:00
parent a93795bcc0
commit 2138dfc0ac
2 changed files with 3 additions and 2 deletions

View File

@ -37,7 +37,8 @@ Feature: Include tags
Scenario: Include a file from a variable
Given I have an _includes directory
And I have an "_includes/snippet.html" file that contains "a snippet"
And I have an "index.html" page that contains "{% assign file = 'snippet.html' %}{% include {{file}} %}"
And I have a configuration file with "include_file" set to "snippet.html"
And I have an "index.html" page that contains "{% include {{site.include_file}} %}"
When I run jekyll
Then the _site directory should exist
And I should see "a snippet" in "_site/index.html"

View File

@ -76,7 +76,7 @@ eos
end
def retrieve_variable(context)
if /\{\{([\w\-]+)\}\}/ =~ @file
if /\{\{([\w\-\.]+)\}\}/ =~ @file
raise ArgumentError.new("No variable #{$1} was found in include tag") if context[$1].nil?
@file = context[$1]
end