Commit 70fc1d5d authored by Sylvester Keil's avatar Sylvester Keil

use liquid builtin variable resolution

parent 62449ee2
......@@ -242,3 +242,38 @@ Feature: Citations
Then the _site directory should exist
And the "_site/scholar.html" file should exist
And I should see "Flanagan" in "_site/scholar.html"
@tags @cite @variables @data
Scenario: A Simple Citation using liquid variables
Given I have a scholar configuration with:
| key | value |
| source | ./_bibliography |
| bibliography | my_references |
And I have a "_bibliography" directory
And I have a file "_bibliography/my_references.bib":
"""
@book{ruby,
title = {The Ruby Programming Language},
author = {Flanagan, David and Matsumoto, Yukihiro},
year = {2008},
publisher = {O'Reilly Media}
}
"""
And I have a "_data" directory
And I have a file "_data/covers.yml":
"""
- reference: "ruby"
image: "/img/covers/cover_01.png"
"""
And I have a page "scholar.html":
"""
---
---
{% for cover in site.data.covers %}
{% cite cover.reference %}
{% endfor %}
"""
When I run jekyll
Then the _site directory should exist
And the "_site/scholar.html" file should exist
And I should see "Flanagan" in "_site/scholar.html"
......@@ -376,6 +376,13 @@ module Jekyll
def set_context_to(context)
@context, @site, = context, context.registers[:site]
config.merge!(site.config['scholar'] || {})
# De-reference keys
keys.map! do |key|
context.send(:resolve, key) || key
end unless keys.nil?
self
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment