jekyll-scholar 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/features/citation.feature +35 -0
- data/lib/jekyll/scholar/utilities.rb +7 -0
- data/lib/jekyll/scholar/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20b4bc03a55f59b2ff1546d6ae1932afd3e9d662
|
4
|
+
data.tar.gz: 61c9c0815aad016ee18ddbabd4937950705ea3ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cefd79645e48e268df1ef87c91a86c293af6167f68fa76307fdba20c8c9e986138cad03f5199b031d220738e3bb91aa8ac7caede94d34614726967a7c1c68ff1
|
7
|
+
data.tar.gz: e6d3dec27c119926edc628ba59c97757ed762d8aabae00e2c5e5497433977f6464b077537c15bfc293e78ba43cda9d2a149a05096dc29022d5f1d40a2003ee58
|
data/features/citation.feature
CHANGED
@@ -242,3 +242,38 @@ Feature: Citations
|
|
242
242
|
Then the _site directory should exist
|
243
243
|
And the "_site/scholar.html" file should exist
|
244
244
|
And I should see "Flanagan" in "_site/scholar.html"
|
245
|
+
|
246
|
+
@tags @cite @variables @data
|
247
|
+
Scenario: A Simple Citation using liquid variables
|
248
|
+
Given I have a scholar configuration with:
|
249
|
+
| key | value |
|
250
|
+
| source | ./_bibliography |
|
251
|
+
| bibliography | my_references |
|
252
|
+
And I have a "_bibliography" directory
|
253
|
+
And I have a file "_bibliography/my_references.bib":
|
254
|
+
"""
|
255
|
+
@book{ruby,
|
256
|
+
title = {The Ruby Programming Language},
|
257
|
+
author = {Flanagan, David and Matsumoto, Yukihiro},
|
258
|
+
year = {2008},
|
259
|
+
publisher = {O'Reilly Media}
|
260
|
+
}
|
261
|
+
"""
|
262
|
+
And I have a "_data" directory
|
263
|
+
And I have a file "_data/covers.yml":
|
264
|
+
"""
|
265
|
+
- reference: "ruby"
|
266
|
+
image: "/img/covers/cover_01.png"
|
267
|
+
"""
|
268
|
+
And I have a page "scholar.html":
|
269
|
+
"""
|
270
|
+
---
|
271
|
+
---
|
272
|
+
{% for cover in site.data.covers %}
|
273
|
+
{% cite cover.reference %}
|
274
|
+
{% endfor %}
|
275
|
+
"""
|
276
|
+
When I run jekyll
|
277
|
+
Then the _site directory should exist
|
278
|
+
And the "_site/scholar.html" file should exist
|
279
|
+
And I should see "Flanagan" in "_site/scholar.html"
|
@@ -376,6 +376,13 @@ module Jekyll
|
|
376
376
|
def set_context_to(context)
|
377
377
|
@context, @site, = context, context.registers[:site]
|
378
378
|
config.merge!(site.config['scholar'] || {})
|
379
|
+
|
380
|
+
# De-reference keys
|
381
|
+
keys.map! do |key|
|
382
|
+
context.send(:resolve, key) || key
|
383
|
+
end unless keys.nil?
|
384
|
+
|
385
|
+
self
|
379
386
|
end
|
380
387
|
end
|
381
388
|
|