diff --git a/features/include_tag.feature b/features/include_tag.feature index f9d4800d..e82f3e60 100644 --- a/features/include_tag.feature +++ b/features/include_tag.feature @@ -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" \ No newline at end of file diff --git a/lib/jekyll/tags/include.rb b/lib/jekyll/tags/include.rb index 4da15d22..cc03d745 100644 --- a/lib/jekyll/tags/include.rb +++ b/lib/jekyll/tags/include.rb @@ -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