jekyll-scholar 7.1.2 → 7.1.3
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/details.feature +99 -0
- data/lib/jekyll/scholar/tags/bibliography.rb +1 -1
- data/lib/jekyll/scholar/utilities.rb +7 -0
- data/lib/jekyll/scholar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a5c64ff0482f1ca07fb43024f2498088c276ecda97488b7d90374c828749712
|
4
|
+
data.tar.gz: fbc7bee4de5eb9453b4d6ee7245b2bc6cc7a6edf86b66ae9bce8c073ad4d32b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 625643f937acb714f7a8da96e621170786cd448a27e59bacac8ed9af4f6e268bf8f94de91efe7035cba1b0ddcf7f5349176e9c8946d78087517d72077ef86250
|
7
|
+
data.tar.gz: 9cbc3ca90920c3267b90b2c08be6e4a7282c6f58d49ef57c9d9f5a364bf46b9e8ac9717236cd1e5325a505640675ec3ad2a64d2387dceb9c3057c1eacdf10d2d
|
data/features/details.feature
CHANGED
@@ -39,6 +39,105 @@ Feature: Details
|
|
39
39
|
And I should see "The Ruby Programming Language" in "_site/bibliography/ruby.html"
|
40
40
|
And I should see "A Comment" in "_site/bibliography/ruby.html"
|
41
41
|
|
42
|
+
@generators
|
43
|
+
Scenario: A bibliography with a single entry with link
|
44
|
+
Given I have a scholar configuration with:
|
45
|
+
| key | value |
|
46
|
+
| source | ./_bibliography |
|
47
|
+
| details_layout | details.html |
|
48
|
+
| details_link | Full details |
|
49
|
+
And I have a "_bibliography" directory
|
50
|
+
And I have a file "_bibliography/references.bib":
|
51
|
+
"""
|
52
|
+
@book{ruby,
|
53
|
+
title = {The Ruby Programming Language},
|
54
|
+
author = {Flanagan, David and Matsumoto, Yukihiro},
|
55
|
+
year = {2008},
|
56
|
+
comment = {A Comment},
|
57
|
+
publisher = {O'Reilly Media}
|
58
|
+
}
|
59
|
+
"""
|
60
|
+
And I have a file "bibliography.html":
|
61
|
+
"""
|
62
|
+
---
|
63
|
+
---
|
64
|
+
<html>
|
65
|
+
<head></head>
|
66
|
+
<body>
|
67
|
+
{%bibliography%}
|
68
|
+
</body>
|
69
|
+
</html>
|
70
|
+
"""
|
71
|
+
And I have a "_layouts" directory
|
72
|
+
And I have a file "_layouts/details.html":
|
73
|
+
"""
|
74
|
+
---
|
75
|
+
---
|
76
|
+
<html>
|
77
|
+
<head></head>
|
78
|
+
<body>
|
79
|
+
{{ page.title }}
|
80
|
+
{{ page.entry.comment }}
|
81
|
+
</body>
|
82
|
+
</html>
|
83
|
+
"""
|
84
|
+
When I run jekyll
|
85
|
+
Then the _site directory should exist
|
86
|
+
And the "_site/bibliography/ruby.html" file should exist
|
87
|
+
And I should see "The Ruby Programming Language" in "_site/bibliography/ruby.html"
|
88
|
+
And I should see "A Comment" in "_site/bibliography/ruby.html"
|
89
|
+
And I should see "Full details" in "_site/bibliography.html"
|
90
|
+
|
91
|
+
@generators
|
92
|
+
Scenario: A bibliography with a single entry but no link
|
93
|
+
Given I have a scholar configuration with:
|
94
|
+
| key | value |
|
95
|
+
| source | ./_bibliography |
|
96
|
+
| details_layout | details.html |
|
97
|
+
| details_link | |
|
98
|
+
And I have a "_bibliography" directory
|
99
|
+
And I have a file "_bibliography/references.bib":
|
100
|
+
"""
|
101
|
+
@book{ruby,
|
102
|
+
title = {The Ruby Programming Language},
|
103
|
+
author = {Flanagan, David and Matsumoto, Yukihiro},
|
104
|
+
year = {2008},
|
105
|
+
comment = {A Comment},
|
106
|
+
publisher = {O'Reilly Media}
|
107
|
+
}
|
108
|
+
"""
|
109
|
+
And I have a file "bibliography.html":
|
110
|
+
"""
|
111
|
+
---
|
112
|
+
---
|
113
|
+
<html>
|
114
|
+
<head></head>
|
115
|
+
<body>
|
116
|
+
{%bibliography%}
|
117
|
+
</body>
|
118
|
+
</html>
|
119
|
+
"""
|
120
|
+
And I have a "_layouts" directory
|
121
|
+
And I have a file "_layouts/details.html":
|
122
|
+
"""
|
123
|
+
---
|
124
|
+
---
|
125
|
+
<html>
|
126
|
+
<head></head>
|
127
|
+
<body>
|
128
|
+
{{ page.title }}
|
129
|
+
{{ page.entry.comment }}
|
130
|
+
</body>
|
131
|
+
</html>
|
132
|
+
"""
|
133
|
+
When I run jekyll
|
134
|
+
Then the _site directory should exist
|
135
|
+
And the "_site/bibliography/ruby.html" file should exist
|
136
|
+
And I should see "The Ruby Programming Language" in "_site/bibliography/ruby.html"
|
137
|
+
And I should see "A Comment" in "_site/bibliography/ruby.html"
|
138
|
+
And I should not see "Full details" in "_site/bibliography.html"
|
139
|
+
|
140
|
+
|
42
141
|
@generators
|
43
142
|
Scenario: LaTeX conversion is applied to everything except the bibtex field
|
44
143
|
Given I have a scholar configuration with:
|
@@ -61,7 +61,7 @@ module Jekyll
|
|
61
61
|
bibliography = items.compact.each_with_index.map { |entry, index|
|
62
62
|
reference = bibliography_tag(entry, index + 1)
|
63
63
|
|
64
|
-
if generate_details?
|
64
|
+
if generate_details? && generate_details_link?
|
65
65
|
reference << link_to(details_link_for(entry),
|
66
66
|
config['details_link'], :class => config['details_link_class'])
|
67
67
|
end
|
@@ -592,6 +592,13 @@ module Jekyll
|
|
592
592
|
e
|
593
593
|
end
|
594
594
|
|
595
|
+
def generate_details_link?
|
596
|
+
if !config['details_link'] then
|
597
|
+
return false
|
598
|
+
end
|
599
|
+
return true
|
600
|
+
end
|
601
|
+
#
|
595
602
|
def generate_details?
|
596
603
|
site.layouts.key?(File.basename(config['details_layout'], '.html'))
|
597
604
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-scholar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.1.
|
4
|
+
version: 7.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvester Keil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|