Commit 86f7aee6 authored by Sylvester Keil's avatar Sylvester Keil

de-reference key variables every time

parent bec4038a
......@@ -278,7 +278,7 @@ Feature: Citations
And the "_site/scholar.html" file should exist
And I should see "Flanagan" in "_site/scholar.html"
@tags @cite @variables @data
@tags @cite @variables @data @wip
Scenario: Multiple Citations in a list using liquid variables
Given I have a scholar configuration with:
| key | value |
......
......@@ -15,7 +15,7 @@ module Jekyll
module Utilities
attr_reader :config, :site, :query,
:context, :prefix, :keys, :text, :max
:context, :prefix, :text, :max
def split_arguments(arguments)
......@@ -373,15 +373,16 @@ module Jekyll
context && context['cited'] || []
end
def keys
# De-reference keys (in case they are variables)
Array(@keys).map do |key|
context.send(:resolve, key) || key
end
end
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