jekyll-scholar 6.5.0 → 6.8.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53ccd7ae4c52e39622c5a4ce64c67c73472112109c4267eac20197f3a2fb23cb
4
- data.tar.gz: 603f2df7070fff4b90ffee8716a28bb79dfd647a28b9619e2d83ce29ef2caad2
3
+ metadata.gz: 9003e905d46343a563b51568a93777e2fda49ede94e0cf34f0efc326eff8d6f8
4
+ data.tar.gz: cc3020a8bd67e1ae7e1a7d069b47c3ffa359dd22f003ab05e7ea15d3fcc66b34
5
5
  SHA512:
6
- metadata.gz: dbaae7c9b3b7cd088466e5e6871e07d469abbdb126cfa0e72726d96075dc434cebbc8872c2b15730fcbb767ff9b97ad1da1be1c1373d8f098d52d1199b5ab951
7
- data.tar.gz: ea232359c182161f33024c5922aeadc33db78c5c5b65b198a3d04b0b9cc5952521f034801defa51e673fe03bcb7d0e44cb324ab58f76b7a10e027c2679772c88
6
+ metadata.gz: 4d297673512e24ba530830d62ae7c3ff89a3a6360593f6bb0cda41ad93e4a64276576ed4d05d47283b66d6825ef9a399f970b01bc616eb5f3bf1aa83794a9978
7
+ data.tar.gz: 57901b71b3ac3c289b19d8c60167593a08928f6a2d8c9608456806e0bab8d5e22e181e2ba547fe9f9db8cbb5e76c0132e9c71205115454355829a7efe6787a9d
@@ -3,8 +3,10 @@ sudo: false
3
3
  cache: bundler
4
4
  matrix:
5
5
  include:
6
- - rvm: 2.6
6
+ - rvm: 2.7
7
7
  env: WITH_COVERALLS=true
8
+ - rvm: 2.6
9
+ env: WITH_COVERALLS=false
8
10
  - rvm: 2.5
9
11
  env: WITH_COVERALLS=false
10
12
  - rvm: 2.4
data/Gemfile CHANGED
@@ -2,22 +2,22 @@ source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  group :development do
5
- gem 'test-unit'
5
+ gem 'cucumber'
6
6
  gem 'rake'
7
+ gem 'redcarpet'
7
8
  gem 'redgreen'
8
9
  gem 'shoulda'
9
- gem 'cucumber', '1.3.11'
10
- gem 'redcarpet'
10
+ gem 'test-unit'
11
11
  gem 'unicode_utils' if RUBY_VERSION < '2.4'
12
12
  end
13
13
 
14
14
  group :extra do
15
- gem 'listen'
15
+ gem 'listen'
16
16
  end
17
17
 
18
18
  group :coverage do
19
- gem 'simplecov', :require => false
20
19
  gem 'coveralls', :require => false
20
+ gem 'simplecov', :require => false
21
21
  end
22
22
 
23
23
  group :debug do
data/README.md CHANGED
@@ -18,7 +18,7 @@ Installation
18
18
 
19
19
  Or add it to your `Gemfile`:
20
20
 
21
- gem 'jekyll-scholar'
21
+ gem 'jekyll-scholar', group: :jekyll_plugins
22
22
 
23
23
  ### Github Pages
24
24
 
@@ -74,6 +74,7 @@ description of all options and their defaults, see
74
74
  | `group_by` | `none` | Specifies how bibliography items are grouped. Grouping can be multi-level, e.g. `type, year` groups entries per publication type, and within those groups per year. |
75
75
  | `group_order` | `ascending` | Ordering for groups is specified in the same way as the sort order. Publication types -- specified with group key `type`, can be ordered by adding `type_order` to the configuration. For example, `type_order: [article,techreport]` lists journal articles before technical reports. Types not mentioned in `type_order` are considered smaller than types that are mentioned. Types can be merge in one group using the `type_aliases` setting. By default `phdthesis` and `mastersthesis` are grouped as `thesis`. By using, for example, `type_aliases: { inproceedings: article}`, journal and conference articles appear in a single group. The display names for entry types are specified with `type_names`. Names for common types are provided, but they can be extended or overridden. For example, the default name for `article` is *Journal Articles*, but it can be changed to *Papers* using `type_names: { article: Papers }`. |
76
76
  | `bibtex_filters` | `latex,smallcaps,superscript` | Configures which [BibTeX-Ruby](https://github.com/inukshuk/bibtex-ruby) formatting filters values of entries should be passed through. The default `latex` filter converts LaTeX character escapes into unicode, `smallcaps` converts the `\textsc` command into a HTML `<font style=\"font-variant: small-caps\">` tag, and `superscript` which converts the `\textsuperscript` command into a HTML `<sup>` tag. |
77
+ | `raw_bibtex_filters` | ` ` | Configures which [BibTeX-Ruby](https://github.com/inukshuk/bibtex-ruby) formatting filters the raw BiBTeX entry (i.e. that available through `{{ entry.bibtex }}`) should be passed through. This can be used to e.g. strip excess newlines by using the `linebreaks` filter. |
77
78
 
78
79
 
79
80
  ### Bibliographies
@@ -501,6 +502,13 @@ can be set via the 'details_link' configuration option).
501
502
  Duis 'aute irure dolor in reprehenderit in voluptate' velit esse cillum
502
503
  dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
503
504
  proident {% cite_details key --text Click Here For More Details %}.
505
+
506
+ Alternatively, you can use the `details_link` tag to get just the URL to
507
+ a details page. This can be used to link to details pages in markdown the
508
+ same way you would link to a blog post with Jekyll's `link` tag.
509
+
510
+ [See our blog post]({% link _posts/2020-01-01-research-post.md %})
511
+ or [find more details]({% details_link key %}).
504
512
 
505
513
 
506
514
  ### Bibliography Filters
@@ -583,7 +583,7 @@ Feature: BibTeX
583
583
  """
584
584
  ---
585
585
  ---
586
- {% bibliography %}
586
+ {% bibliography --style apa-6th-edition %}
587
587
  """
588
588
  When I run jekyll
589
589
  Then the _site directory should exist
@@ -619,7 +619,7 @@ Feature: BibTeX
619
619
  Given I have a scholar configuration with:
620
620
  | key | value |
621
621
  | source | ./_bibliography |
622
- | bibliography_template | <pre>{{entry.raw_bibtex}}</pre> |
622
+ | bibliography_template | <pre>{{entry.bibtex}}</pre> |
623
623
  And I have a "_bibliography" directory
624
624
  And I have a file "_bibliography/references.bib":
625
625
  """
@@ -638,3 +638,4 @@ Feature: BibTeX
638
638
  Then the _site directory should exist
639
639
  And the "_site/scholar.html" file should exist
640
640
  And I should see "{{No Escape}}" in "_site/scholar.html"
641
+ And I should not see "raw" in "_site/scholar.html"
@@ -140,3 +140,31 @@ Feature: Citations
140
140
  Then the _site directory should exist
141
141
  And the "_site/scholar.html" file should exist
142
142
  And I should see "Click For More</a>" in "_site/scholar.html"
143
+
144
+ @tags @details_link
145
+ Scenario: A Simple Details Link
146
+ Given I have a scholar configuration with:
147
+ | key | value |
148
+ | source | ./_bibliography |
149
+ | bibliography | my_references |
150
+ And I have a "_bibliography" directory
151
+ And I have a file "_bibliography/my_references.bib":
152
+ """
153
+ @book{ruby,
154
+ title = {The Ruby Programming Language},
155
+ author = {Flanagan, David and Matsumoto, Yukihiro},
156
+ year = {2008},
157
+ publisher = {O'Reilly Media}
158
+ }
159
+ """
160
+ And I have a page "scholar.html":
161
+ """
162
+ ---
163
+ ---
164
+ {% details_link ruby %}
165
+ """
166
+ When I run jekyll
167
+ Then the _site directory should exist
168
+ And the "_site/scholar.html" file should exist
169
+ And I should see "/bibliography/ruby.html" in "_site/scholar.html"
170
+ And I should not see ""<a>"" in "_site/scholar.html"
@@ -107,7 +107,7 @@ Feature: Details
107
107
  And I should see "Page title: An Umlaut \\\"a!" in "_site/bibliography/ruby.html"
108
108
  And I should see "Title: An Umlaut \\\"a!" in "_site/bibliography/ruby.html"
109
109
  And I should see "title = {An Umlaut \\\"a!}" in "_site/bibliography/ruby.html"
110
-
110
+
111
111
 
112
112
  @generators
113
113
  Scenario: Liquid tags should not be parsed inside the bibtex
@@ -438,8 +438,8 @@ Feature: Details
438
438
  And the "_site/scholar/index.html" file should exist
439
439
  And I should see "<a[^>]+href=\"/blog/bibliography/2008/10.0000/1111/\">" in "_site/scholar/index.html"
440
440
  And I should see "<a[^>]+href=\"/blog/bibliography/2018/ruby/\">" in "_site/scholar/index.html"
441
- And the "_site/blog/bibliography/2008/10.0000/1111/index.html" file should exist
442
- And the "_site/blog/bibliography/2018/ruby/index.html" file should exist
441
+ And the "_site/bibliography/2008/10.0000/1111/index.html" file should exist
442
+ And the "_site/bibliography/2018/ruby/index.html" file should exist
443
443
 
444
444
  @generators @parse_months
445
445
  Scenario: Months are parsed by default
@@ -161,7 +161,7 @@ Feature: BibTeX
161
161
  """
162
162
  ---
163
163
  ---
164
- {% bibliography %}
164
+ {% bibliography --style apa-6th-edition %}
165
165
  """
166
166
  When I run jekyll
167
167
  Then the _site directory should exist
@@ -192,7 +192,7 @@ Feature: BibTeX
192
192
  """
193
193
  ---
194
194
  ---
195
- {% bibliography %}
195
+ {% bibliography --style apa-6th-edition %}
196
196
  """
197
197
  When I run jekyll
198
198
  Then the _site directory should exist
@@ -609,3 +609,39 @@ Feature: BibTeX
609
609
  And the "_site/scholar.html" file should exist
610
610
  And I should see "This is <span class="tiny">i is tiny</span> to me." in "_site/scholar.html"
611
611
 
612
+ @tags @filters
613
+ Scenario: Apply raw BiBTeX filters
614
+ Given I have a scholar configuration with:
615
+ | key | value |
616
+ | source | ./_bibliography |
617
+ | bibliography_template | bibliography |
618
+ And I have the following raw BibTeX filters:
619
+ | linebreaks |
620
+ And I have a "_bibliography" directory
621
+ And I have a file "_bibliography/references.bib":
622
+ """
623
+ @misc{pickaxe,
624
+ title = {Long
625
+ line},
626
+ series = {Longer
627
+ line}
628
+ }
629
+ """
630
+ And I have a "_layouts" directory
631
+ And I have a file "_layouts/bibliography.html":
632
+ """
633
+ ---
634
+ ---
635
+ {{ entry.bibtex }}
636
+ """
637
+ And I have a page "scholar.html":
638
+ """
639
+ ---
640
+ ---
641
+ {% bibliography %}
642
+ """
643
+ When I run jekyll
644
+ Then the _site directory should exist
645
+ And the "_site/scholar.html" file should exist
646
+ And I should see "@misc{pickaxe,\n title = {Long line},\n series = {Longer line}" in "_site/scholar.html"
647
+
@@ -0,0 +1,42 @@
1
+ Feature: Page Configuration
2
+ As a scholar who likes to blog
3
+ I want to set local jekyll-scholar options per page
4
+ In order to override the global config
5
+
6
+ @tags @filters
7
+ Scenario: Filter by Year
8
+ Given I have a scholar configuration with:
9
+ | key | value |
10
+ | source | ./_bibliography |
11
+ | query | "@*[year=2009]" |
12
+ And I have a "_bibliography" directory
13
+ And I have a file "_bibliography/references.bib":
14
+ """
15
+ @book{ruby,
16
+ title = {The Ruby Programming Language},
17
+ author = {Flanagan, David and Matsumoto, Yukihiro},
18
+ year = {2008},
19
+ publisher = {O'Reilly Media}
20
+ }
21
+ @book{pickaxe,
22
+ title = {Programming Ruby 1.9: The Pragmatic Programmer's Guide},
23
+ author = {Thomas, Dave and Fowler, Chad and Hunt, Andy},
24
+ year = {2009},
25
+ edition = 3,
26
+ publisher = {Pragmatic Bookshelf}
27
+ }
28
+ """
29
+ And I have a page "scholar.html":
30
+ """
31
+ ---
32
+ scholar:
33
+ query: "@*[year=2008]"
34
+ ---
35
+ {% bibliography %}
36
+ """
37
+ When I run jekyll
38
+ Then the _site directory should exist
39
+ And the "_site/scholar.html" file should exist
40
+ And I should see "The Ruby Programming Language" in "_site/scholar.html"
41
+ And I should not see "Programming Ruby" in "_site/scholar.html"
42
+
@@ -36,6 +36,15 @@ Given(/^I have the following BibTeX filters:$/) do |table|
36
36
  end
37
37
  end
38
38
 
39
+ Given(/^I have the following raw BibTeX filters:$/) do |table|
40
+ File.open('_config.yml', 'a') do |f|
41
+ f.write(" raw_bibtex_filters:\n")
42
+ table.raw.flatten.each do |row|
43
+ f.write(" - #{row}\n")
44
+ end
45
+ end
46
+ end
47
+
39
48
  Then(/^"(.*)" should come before "(.*)" in "(.*)"$/) do |p1, p2, file|
40
49
  data = File.open(file).readlines.join('')
41
50
 
@@ -6,16 +6,12 @@ rescue LoadError
6
6
  end
7
7
 
8
8
  begin
9
- if RUBY_VERSION > '2.0'
10
- require 'byebug'
11
- else
12
- require 'debugger'
13
- end
9
+ require 'byebug'
14
10
  rescue LoadError
15
11
  # ignore
16
12
  end
17
13
 
18
- require 'test/unit'
14
+ require 'minitest/test'
19
15
  require 'jekyll/scholar'
20
16
  require 'tmpdir'
21
17
 
@@ -32,7 +28,6 @@ def prepend_test_dir(options, key)
32
28
  end
33
29
 
34
30
  def run_jekyll(options = {})
35
-
36
31
  options = Jekyll.configuration(options)
37
32
 
38
33
  prepend_test_dir(options, 'source')
@@ -42,5 +37,4 @@ def run_jekyll(options = {})
42
37
  print options['destination'] + "\n"
43
38
  site = Jekyll::Site.new(options)
44
39
  site.process
45
-
46
40
  end
@@ -5,6 +5,8 @@ Before do
5
5
  end
6
6
 
7
7
  After do
8
- FileUtils.rm_rf(TEST_DIR) if File.exist?(TEST_DIR)
8
+ if File.exist?(TEST_DIR)
9
+ FileUtils.rm_rf(TEST_DIR)
10
+ Dir.chdir(File.dirname(TEST_DIR))
11
+ end
9
12
  end
10
-
@@ -23,7 +23,6 @@ Gem::Specification.new do |s|
23
23
  s.date = Time.now
24
24
 
25
25
  s.required_rubygems_version = '>= 1.3.6'
26
- s.rubyforge_project = s.name
27
26
 
28
27
  s.add_runtime_dependency('jekyll', '~> 4.0')
29
28
  s.add_runtime_dependency('citeproc-ruby', '~> 1.0')
@@ -17,6 +17,7 @@ require 'jekyll/scholar/tags/bibliography_count'
17
17
  require 'jekyll/scholar/tags/bibtex'
18
18
  require 'jekyll/scholar/tags/cite'
19
19
  require 'jekyll/scholar/tags/cite_details'
20
+ require 'jekyll/scholar/tags/details_link'
20
21
  require 'jekyll/scholar/tags/quote'
21
22
  require 'jekyll/scholar/tags/reference'
22
23
  require 'jekyll/scholar/generators/details'
@@ -37,6 +37,7 @@ module Jekyll
37
37
 
38
38
  'bibtex_options' => { :strip => false, :parse_months => true },
39
39
  'bibtex_filters' => [ :smallcaps, :superscript, :italics, :textit, :lowercase, :textregistered, :tiny, :latex ],
40
+ 'raw_bibtex_filters' => [ ],
40
41
  'bibtex_skip_fields' => [ :abstract, :month_numeric ],
41
42
  'bibtex_quotes' => ['{', '}'],
42
43
 
@@ -23,7 +23,7 @@ module Jekyll
23
23
 
24
24
  def url
25
25
  # Reuse the logic in the utilities module for deciding URLs
26
- details_link_for(@entry)
26
+ details_path_for(@entry)
27
27
  end
28
28
  end
29
29
 
@@ -1,6 +1,5 @@
1
1
  module Jekyll
2
2
  class Scholar
3
-
4
3
  class BibliographyTag < Liquid::Tag
5
4
  include Scholar::Utilities
6
5
 
@@ -34,7 +33,7 @@ module Jekyll
34
33
  def render_groups(groups)
35
34
  def group_renderer(groupsOrItems,keys,order,tags)
36
35
  if keys.count == 0
37
- renderer(true)
36
+ csl_renderer(true)
38
37
  render_items(groupsOrItems)
39
38
  else
40
39
  groupsOrItems
@@ -1,6 +1,5 @@
1
1
  module Jekyll
2
2
  class Scholar
3
-
4
3
  class BibTeXTag < Liquid::Block
5
4
  include Scholar::Utilities
6
5
 
@@ -15,16 +14,13 @@ module Jekyll
15
14
 
16
15
  def render(context)
17
16
  set_context_to context
18
-
17
+
19
18
  BibTeX.parse(super, bibtex_options).map { |entry|
20
19
  reference_tag entry
21
-
22
20
  }.join("\n")
23
21
  end
24
22
  end
25
-
26
23
  end
27
24
  end
28
25
 
29
26
  Liquid::Template.register_tag('bibtex', Jekyll::Scholar::BibTeXTag)
30
-
@@ -0,0 +1,25 @@
1
+ module Jekyll
2
+ class Scholar
3
+
4
+ class DetailsLinkTag < Liquid::Tag
5
+ include Scholar::Utilities
6
+
7
+ def initialize(tag_name, arguments, tokens)
8
+ super
9
+
10
+ @config = Scholar.defaults.dup
11
+ @keys, arguments = split_arguments arguments
12
+
13
+ optparse(arguments)
14
+ end
15
+
16
+ def render(context)
17
+ set_context_to context
18
+ details_link keys[0]
19
+ end
20
+ end
21
+
22
+ end
23
+ end
24
+
25
+ Liquid::Template.register_tag('details_link', Jekyll::Scholar::DetailsLinkTag)
@@ -165,6 +165,10 @@ module Jekyll
165
165
  config['bibtex_filters'] ||= []
166
166
  end
167
167
 
168
+ def raw_bibtex_filters
169
+ config['raw_bibtex_filters'] ||= []
170
+ end
171
+
168
172
  def bibtex_paths
169
173
  bibtex_files.map { |file|
170
174
  interpolated_file = interpolate file
@@ -518,7 +522,7 @@ module Jekyll
518
522
  def bibliography_tag(entry, index)
519
523
  return missing_reference unless entry
520
524
 
521
- tmp = liquid_template.render(
525
+ liquid_template.render(
522
526
  reference_data(entry,index)
523
527
  .merge(site.site_payload)
524
528
  .merge({
@@ -528,17 +532,7 @@ module Jekyll
528
532
  {
529
533
  :registers => { :site => site },
530
534
  :filters => [Jekyll::Filters]
531
- }
532
- )
533
- # process the generated reference with Liquid, to get the same behaviour as
534
- # when it is used on a page
535
- Liquid::Template.parse(tmp).render(
536
- site.site_payload,
537
- {
538
- :registers => { :site => site },
539
- :filters => [Jekyll::Filters]
540
- }
541
- )
535
+ })
542
536
  end
543
537
 
544
538
  def reference_data(entry, index = nil)
@@ -558,8 +552,13 @@ module Jekyll
558
552
  e['key'] = entry.key
559
553
  e['type'] = entry.type.to_s
560
554
 
555
+ conv_opts = { quotes: config['bibtex_quotes'] }
556
+ if !raw_bibtex_filters.empty?
557
+ conv_opts[:filter] = *raw_bibtex_filters
558
+ end
559
+
561
560
  if entry.field_names(config['bibtex_skip_fields']).empty?
562
- e['bibtex'] = entry.to_s({ quotes: config['bibtex_quotes'] })
561
+ e['bibtex'] = entry.to_s(conv_opts)
563
562
  else
564
563
  tmp = entry.dup
565
564
 
@@ -567,10 +566,10 @@ module Jekyll
567
566
  tmp.delete name if tmp.field?(name)
568
567
  end
569
568
 
570
- e['bibtex'] = tmp.to_s({ quotes: config['bibtex_quotes'] })
569
+ e['bibtex'] = tmp.to_s(conv_opts)
571
570
  end
572
571
 
573
- e['raw_bibtex'] = "{%raw%}#{e['bibtex']}{%endraw%}"
572
+ #e['raw_bibtex'] = "{%raw%}#{e['bibtex']}{%endraw%}"
574
573
 
575
574
  entry.fields.each do |key, value|
576
575
  value = value.convert(*bibtex_filters) unless bibtex_filters.empty?
@@ -616,6 +615,10 @@ module Jekyll
616
615
  end
617
616
 
618
617
  def details_link_for(entry, base = base_url)
618
+ File.join(base, details_path_for(entry))
619
+ end
620
+
621
+ def details_path_for(entry)
619
622
  # Expand the details_permalink template into the complete URL for this entry.
620
623
 
621
624
  # First generate placeholders for all items in the bibtex entry
@@ -625,29 +628,30 @@ module Jekyll
625
628
  value = Jekyll::Utils::slugify(value, :mode => 'pretty') unless k == :doi
626
629
  url_placeholders[k] = value
627
630
  end
628
- # Maintain the same URLs are previous versions of jekyll-scholar by replicating the way that it
629
- # processed the key.
631
+ # Maintain the same URLs are previous versions of jekyll-scholar
632
+ # by replicating the way that it processed the key.
630
633
  url_placeholders[:key] = entry.key.to_s.gsub(/[:\s]+/, '_')
631
634
  url_placeholders[:details_dir] = details_path
632
- # Autodetect the appropriate file extension based upon the site config, using the same rules as
633
- # previous versions of jekyll-scholar. Uses can override these settings by defining a details_permalink
635
+
636
+ # Autodetect the appropriate file extension based upon the site config,
637
+ # using the same rules as previous versions of jekyll-scholar. Users can
638
+ # override these settings by defining a details_permalink
634
639
  # without the :extension field.
635
640
  if (site.config['permalink'] == 'pretty') || (site.config['permalink'].end_with? '/')
636
641
  url_placeholders[:extension] = '/'
637
642
  else
638
643
  url_placeholders[:extension] = '.html'
639
644
  end
640
- # Overwrite the 'doi' key with the citation key if the DOI field is empty or missing
645
+
646
+ # Overwrite 'doi' key with the citation key if DOI field is empty or missing
641
647
  if !entry.has_field?('doi') || entry.doi.empty?
642
648
  url_placeholders[:doi] = url_placeholders[:key]
643
649
  end
644
650
 
645
- # generate the URL
646
- File.join(base,
647
- URL.new(
648
- :template => config['details_permalink'],
649
- :placeholders => url_placeholders
650
- ).to_s)
651
+ URL.new(
652
+ template: config['details_permalink'],
653
+ placeholders: url_placeholders
654
+ ).to_s
651
655
  end
652
656
 
653
657
  def base_url
@@ -658,15 +662,15 @@ module Jekyll
658
662
  config['details_dir']
659
663
  end
660
664
 
661
- def renderer(force = false)
662
- return @renderer if @renderer && !force
665
+ def csl_renderer(force = false)
666
+ return @csl_renderer if @csl_renderer && !force
663
667
 
664
- @renderer = CiteProc::Ruby::Renderer.new :format => 'html',
668
+ @csl_renderer = CiteProc::Ruby::Renderer.new :format => 'html',
665
669
  :style => style, :locale => config['locale']
666
670
  end
667
671
 
668
672
  def render_citation(items)
669
- renderer.render items.zip(locators.zip(labels)).map { |entry, (locator, label)|
673
+ csl_renderer.render items.zip(locators.zip(labels)).map { |entry, (locator, label)|
670
674
  cited_keys << entry.key
671
675
  cited_keys.uniq!
672
676
 
@@ -680,17 +684,17 @@ module Jekyll
680
684
 
681
685
  def render_bibliography(entry, index = nil)
682
686
  begin
683
- original_locale, renderer.locale =
684
- renderer.locale, locales(entry.language)
687
+ original_locale = csl_renderer.locale
688
+ csl_renderer.locale = locales(entry.language)
685
689
  rescue
686
690
  # Locale failed to load; just use original one!
687
691
  end if allow_locale_overrides? &&
688
- entry['language'] != renderer.locale.language
692
+ entry['language'] != csl_renderer.locale.language
689
693
 
690
- renderer.render citation_item_for(entry, index),
694
+ csl_renderer.render citation_item_for(entry, index),
691
695
  styles(style).bibliography
692
696
  ensure
693
- renderer.locale = original_locale unless original_locale.nil?
697
+ csl_renderer.locale = original_locale unless original_locale.nil?
694
698
  end
695
699
 
696
700
  def citation_item_for(entry, citation_number = nil)
@@ -734,6 +738,14 @@ module Jekyll
734
738
  end
735
739
  end
736
740
 
741
+ def details_link(key)
742
+ if bibliography.key?(key)
743
+ details_link_for(bibliography[key])
744
+ else
745
+ raise Exception.new "Could not find entry for key '%s'" % key
746
+ end
747
+ end
748
+
737
749
  def content_tag(name, content_or_attributes, attributes = {})
738
750
  if content_or_attributes.is_a?(Hash)
739
751
  content, attributes = nil, content_or_attributes
@@ -776,8 +788,9 @@ module Jekyll
776
788
  end
777
789
 
778
790
  def set_context_to(context)
779
- @context, @site, = context, context.registers[:site]
791
+ @context, @site, page, = context, *context.registers.values_at(:site, :page)
780
792
  config.merge!(site.config['scholar'] || {})
793
+ config.merge!(page['scholar'] || {})
781
794
  self
782
795
  end
783
796
 
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class Scholar
3
- VERSION = '6.5.0'.freeze
3
+ VERSION = '6.8.0'.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.5.0
4
+ version: 6.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-22 00:00:00.000000000 Z
11
+ date: 2020-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -97,6 +97,7 @@ files:
97
97
  - features/interpolate.feature
98
98
  - features/layout.feature
99
99
  - features/multiple_files.feature
100
+ - features/page_config.feature
100
101
  - features/reference.feature
101
102
  - features/removeduplicate.feature
102
103
  - features/repository.feature
@@ -125,6 +126,7 @@ files:
125
126
  - lib/jekyll/scholar/tags/bibtex.rb
126
127
  - lib/jekyll/scholar/tags/cite.rb
127
128
  - lib/jekyll/scholar/tags/cite_details.rb
129
+ - lib/jekyll/scholar/tags/details_link.rb
128
130
  - lib/jekyll/scholar/tags/quote.rb
129
131
  - lib/jekyll/scholar/tags/reference.rb
130
132
  - lib/jekyll/scholar/utilities.rb
@@ -133,7 +135,7 @@ homepage: http://github.com/inukshuk/jekyll-scholar
133
135
  licenses:
134
136
  - MIT
135
137
  metadata: {}
136
- post_install_message:
138
+ post_install_message:
137
139
  rdoc_options: []
138
140
  require_paths:
139
141
  - lib
@@ -148,8 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
150
  - !ruby/object:Gem::Version
149
151
  version: 1.3.6
150
152
  requirements: []
151
- rubygems_version: 3.0.3
152
- signing_key:
153
+ rubygems_version: 3.1.2
154
+ signing_key:
153
155
  specification_version: 4
154
156
  summary: Jekyll extensions for the academic blogger.
155
157
  test_files:
@@ -166,6 +168,7 @@ test_files:
166
168
  - features/interpolate.feature
167
169
  - features/layout.feature
168
170
  - features/multiple_files.feature
171
+ - features/page_config.feature
169
172
  - features/reference.feature
170
173
  - features/removeduplicate.feature
171
174
  - features/repository.feature