jekyll-scholar 6.3.1 → 6.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 452e18974fffbcc53b889b3c5669fbcd545a327462a72b3d331764019e9fc664
4
- data.tar.gz: 90aab98a5f43f43c90a576b8eb1df3a2c05c9ca7581d6112871ad9172f4ddcb2
3
+ metadata.gz: aea0dbf09c4b9675d2341466637d0d869ca493ae944bd4a151d62d080debada1
4
+ data.tar.gz: a060e41c331f683ac52f7eaff50d42e3c50f9715e415f6326cc6fc6c1efddf6f
5
5
  SHA512:
6
- metadata.gz: 03156b59764f5e578aa60b227b4308d3590b96490a2a5ae2dd5bc4c50b689a3aedcfb98e98a1415207e59b7b60eba0fd7f0d6d8cf2d4b0d4e7b75d417e50e6d3
7
- data.tar.gz: 6a626feb3f485af7d4f7ef8ff76064f520bf7351fed4ee764b27e0c2f5ea15b4046acd07a5520a7248b91d166300ff0372b25cba939f88ac82658f04a3575c5d
6
+ metadata.gz: b529c1db74c86b0fdc854725b3251463a06a18c5818cff4630ba17a5d34bf661f3a3c33bd23bcaee553cb5b9e4edbd5d9c4d602f67bd48ee4d811205c3690561
7
+ data.tar.gz: 3bbef145e79ef2e5e18732ec345f94726ca97e55a040c57509dc51308f8fafdf24ab21c010570f52eeef7fbcf79248f042ed1910c6a2f81293abdee42bc44d91
@@ -557,3 +557,35 @@ Feature: BibTeX
557
557
  And the "_site/scholar.html" file should exist
558
558
  And I should see "Estudios de Asia y Africa</i>, n.º 22" in "_site/scholar.html"
559
559
  And I should see "Estudios De Asia y Africa</i>, no. 22" in "_site/scholar.html"
560
+
561
+ @latex
562
+ Scenario: Simple Bibliography with LaTeX directives
563
+ Given I have a "_bibliography" directory
564
+ And I have a file "_bibliography/references.bib":
565
+ """
566
+ @book{rosso_image_2006,
567
+ address = {{Paris}},
568
+ series = {{Arch{\'e}ologie et histoire de l'art}},
569
+ title = {{L'image de l'empereur en Gaule romaine : portraits et inscriptions}},
570
+ isbn = {978-2-7355-0583-8},
571
+ lccn = {Tolbiac - Rez de Jardin - Philosophie, histoire, sciences de l'homme - Magasin - 2006-174258},
572
+ shorttitle = {{L'image de l'empereur en Gaule romaine}},
573
+ language = {fre},
574
+ number = {20},
575
+ publisher = {{{\'E}d. du Comit{\'e} des travaux historiques et scientifiques}},
576
+ author = {Rosso, Emmanuelle},
577
+ year = {2006},
578
+ keywords = {Empereurs,Inscriptions latines,Sculpture de portraits romaine},
579
+ note = {ill., couv. ill. 27 cm. Ouvrage issu des m{\'e}moires de ma{\^i}trise et de DEA. Bibliogr. p. 561-582. Notes bibliogr.}
580
+ }
581
+ """
582
+ And I have a page "test.md":
583
+ """
584
+ ---
585
+ ---
586
+ {% bibliography %}
587
+ """
588
+ When I run jekyll
589
+ Then the _site directory should exist
590
+ And the "_site/test.html" file should exist
591
+ And I should see "L’image de l’empereur en Gaule romaine" in "_site/test.html"
@@ -49,3 +49,67 @@ Feature: Bibliographies in Layouts
49
49
  And I should see "<i>Smalltalk Best Practice Patterns</i>" in "_site/scholar.html"
50
50
 
51
51
 
52
+ Scenario: I want to interpolate variables in my layout
53
+ Given I have a "_bibliography" directory
54
+ And I have a file "_bibliography/a.bib":
55
+ """
56
+ @book{ruby,
57
+ title = {The Ruby Programming Language},
58
+ author = {Flanagan, David and Matsumoto, Yukihiro},
59
+ year = {2008},
60
+ publisher = {O'Reilly Media}
61
+ }
62
+ """
63
+ And I have a file "_bibliography/b.bib":
64
+ """
65
+ @book{smalltalk,
66
+ title = {Smalltalk Best Practice Patterns},
67
+ author = {Kent Beck},
68
+ year = {1996},
69
+ publisher = {Prentice Hall}
70
+ }
71
+ """
72
+ And I have a "_layouts" directory
73
+ And I have a file "_layouts/page.html":
74
+ """
75
+ ---
76
+ ---
77
+ {{ page.title }}
78
+ <div>
79
+ {{ content }}
80
+ </div>
81
+ <div>
82
+ {% bibliography --file {{page.bibliography}} %}
83
+ </div>
84
+ """
85
+ And I have a page "a.html":
86
+ """
87
+ ---
88
+ layout: page
89
+ title: Page A
90
+ bibliography: a
91
+ ---
92
+ A-A-A
93
+ """
94
+ And I have a page "b.html":
95
+ """
96
+ ---
97
+ layout: page
98
+ title: Page B
99
+ bibliography: b
100
+ ---
101
+ B-B-B
102
+ """
103
+ When I run jekyll
104
+ Then the _site directory should exist
105
+ And the "_site/a.html" file should exist
106
+ And I should see "Page A" in "_site/a.html"
107
+ And I should see "A-A-A" in "_site/a.html"
108
+ And I should see "<i>The Ruby Programming Language</i>" in "_site/a.html"
109
+ And I should not see "<i>Smalltalk Best Practice Patterns</i>" in "_site/a.html"
110
+ And the "_site/b.html" file should exist
111
+ And I should see "Page B" in "_site/b.html"
112
+ And I should see "B-B-B" in "_site/b.html"
113
+ And I should see "<i>Smalltalk Best Practice Patterns</i>" in "_site/b.html"
114
+ And I should not see "<i>The Ruby Programming Language</i>" in "_site/b.html"
115
+
@@ -166,7 +166,7 @@ module Jekyll
166
166
  end
167
167
 
168
168
  def bibtex_paths
169
- @bibtex_paths ||= bibtex_files.map { |file|
169
+ bibtex_files.map { |file|
170
170
  interpolated_file = interpolate file
171
171
  extend_path interpolated_file
172
172
  }
@@ -178,21 +178,35 @@ module Jekyll
178
178
  end
179
179
 
180
180
  def bibliography
181
+ paths = bibtex_paths
182
+
183
+ # Clear @bibliography if sources change! See #282
184
+ unless @paths.nil? || @paths == paths
185
+ @bibliography = nil
186
+ end
187
+
181
188
  unless @bibliography
182
189
  @bibliography = BibTeX::Bibliography.parse(
183
- bibtex_paths.reduce('') { |s, p| s << IO.read(p) },
190
+ paths.reduce('') { |s, p| s << IO.read(p) },
184
191
  bibtex_options
185
192
  )
193
+
194
+ @paths = paths
195
+
186
196
  @bibliography.replace_strings if replace_strings?
187
197
  @bibliography.join if join_strings? && replace_strings?
188
- end
189
198
 
190
- # Remove duplicate entries
191
- @bibliography.uniq!(*match_fields) if remove_duplicates?
199
+ # Remove duplicate entries
200
+ @bibliography.uniq!(*match_fields) if remove_duplicates?
201
+ end
192
202
 
193
203
  @bibliography
194
204
  end
195
205
 
206
+ def bibliography_stale?
207
+ end
208
+
209
+
196
210
  def query
197
211
  interpolate @query
198
212
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class Scholar
3
- VERSION = '6.3.1'.freeze
3
+ VERSION = '6.3.2'.freeze
4
4
  end
5
5
  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: 6.3.1
4
+ version: 6.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-28 00:00:00.000000000 Z
11
+ date: 2019-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll