Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
Feature: Interpolations ... | ||
As a scholar who likes to blog | ||
I want to reference cool papers and books from my bibliography | ||
|
||
@tags @reference @liquid @interpolate | ||
Scenario: Interpolate 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 file "custom.csl": | ||
""" | ||
<style> | ||
<citation> | ||
<layout> | ||
<text variable="title"/> | ||
</layout> | ||
</citation> | ||
<bibliography> | ||
<layout> | ||
<text variable="title"/> | ||
</layout> | ||
</bibliography> | ||
</style> | ||
""" | ||
And I have a page "scholar.html": | ||
""" | ||
--- | ||
--- | ||
{% assign style_file = 'custom.csl' %} | ||
{% bibliography --style {{style_file}} %} | ||
""" | ||
When I run jekyll | ||
Then the _site directory should exist | ||
And the "_site/scholar.html" file should exist | ||
And I should see "The Ruby Programming Language" in "_site/scholar.html" | ||
|
||
|
||
@tags @grouping | ||
Scenario: Local grouping override - grouping by year with interpolation | ||
Given I have a scholar configuration with: | ||
| key | value | | ||
| group_by | none | | ||
| group_order | ascending | | ||
And I have a "_bibliography" directory | ||
And I have a file "_bibliography/references.bib": | ||
""" | ||
@book{ruby1, | ||
title = {The Ruby Programming Language}, | ||
author = {Flanagan, David and Matsumoto, Yukihiro}, | ||
year = {2008}, | ||
publisher = {O'Reilly Media} | ||
} | ||
@book{ruby2, | ||
title = {The Ruby Programming Language}, | ||
author = {Flanagan, David and Matsumoto, Yukihiro}, | ||
year = {2007}, | ||
publisher = {O'Reilly Media} | ||
} | ||
""" | ||
And I have a page "scholar.html": | ||
""" | ||
--- | ||
--- | ||
{% assign group_year = 'year' %} | ||
{% bibliography -f references --group_by {{group_year}} --group_order descending %} | ||
""" | ||
When I run jekyll | ||
Then the _site directory should exist | ||
And the "_site/scholar.html" file should exist | ||
Then I should see "<h2 class=\"bibliography\">2007</h2>" in "_site/scholar.html" | ||
And I should see "<h2 class=\"bibliography\">2008</h2>" in "_site/scholar.html" | ||
And "2008" should come before "2007" in "_site/scholar.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters