jekyll-scholar 6.6.1 → 6.7.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: bf67ce28716d6238d1ba9306450a14c19ba4f9856071373dd05f3796b655bdaf
4
- data.tar.gz: 96ab65e69d8c14e01e5d802dafe9091458c28eb373d5b37b9479bdd3439bf8ef
3
+ metadata.gz: 7d41078acb5e68890960f62592839d27cf1fac7d305f41dac27fedf556f1c62d
4
+ data.tar.gz: 5a00d7a0c00455a47ccd56b0e9584bdf16811baf4a90f126c05de1b02de975ee
5
5
  SHA512:
6
- metadata.gz: d0629713d0e4f78640df2b32f7c9895726a17db5087eed933f2b7c34b7242b9aeff4ff0bcd6d7e4ae2401ac4c4946d158d454189a7653089b3f44ca2dd373751
7
- data.tar.gz: 49272efe88a89be98a9f5c9b06ea3b825579c536abc342e6197607340a9aa4a14ae94bf7f324718c100875633506e098ba9bc28554fd2cf5e765e82a0d4789ac
6
+ metadata.gz: f9fafa23f51a0e6790e547271ec26707455beacdfddac3780a83cbd06af5bd6ab42aae3f4a056f3c44323d93758a8c6dc3f4b6f01762f9fea311b4c05b8fa45c
7
+ data.tar.gz: f9682cccf0b8bea4248b56702dc0e6349b5e5dfcfc074319bfa88bddfc1de2a841f7c49ec57e895dbb747e5c8e04e0600739cb67b2cc299d239904dc593d2794
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
 
@@ -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
@@ -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
+
@@ -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
 
@@ -615,6 +615,10 @@ module Jekyll
615
615
  end
616
616
 
617
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)
618
622
  # Expand the details_permalink template into the complete URL for this entry.
619
623
 
620
624
  # First generate placeholders for all items in the bibtex entry
@@ -624,29 +628,30 @@ module Jekyll
624
628
  value = Jekyll::Utils::slugify(value, :mode => 'pretty') unless k == :doi
625
629
  url_placeholders[k] = value
626
630
  end
627
- # Maintain the same URLs are previous versions of jekyll-scholar by replicating the way that it
628
- # processed the key.
631
+ # Maintain the same URLs are previous versions of jekyll-scholar
632
+ # by replicating the way that it processed the key.
629
633
  url_placeholders[:key] = entry.key.to_s.gsub(/[:\s]+/, '_')
630
634
  url_placeholders[:details_dir] = details_path
631
- # Autodetect the appropriate file extension based upon the site config, using the same rules as
632
- # 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
633
639
  # without the :extension field.
634
640
  if (site.config['permalink'] == 'pretty') || (site.config['permalink'].end_with? '/')
635
641
  url_placeholders[:extension] = '/'
636
642
  else
637
643
  url_placeholders[:extension] = '.html'
638
644
  end
639
- # 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
640
647
  if !entry.has_field?('doi') || entry.doi.empty?
641
648
  url_placeholders[:doi] = url_placeholders[:key]
642
649
  end
643
650
 
644
- # generate the URL
645
- File.join(base,
646
- URL.new(
647
- :template => config['details_permalink'],
648
- :placeholders => url_placeholders
649
- ).to_s)
651
+ URL.new(
652
+ template: config['details_permalink'],
653
+ placeholders: url_placeholders
654
+ ).to_s
650
655
  end
651
656
 
652
657
  def base_url
@@ -783,8 +788,9 @@ module Jekyll
783
788
  end
784
789
 
785
790
  def set_context_to(context)
786
- @context, @site, = context, context.registers[:site]
791
+ @context, @site, page, = context, *context.registers.values_at(:site, :page)
787
792
  config.merge!(site.config['scholar'] || {})
793
+ config.merge!(page['scholar'] || {})
788
794
  self
789
795
  end
790
796
 
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class Scholar
3
- VERSION = '6.6.1'.freeze
3
+ VERSION = '6.7.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.6.1
4
+ version: 6.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-09 00:00:00.000000000 Z
11
+ date: 2020-04-26 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
@@ -167,6 +168,7 @@ test_files:
167
168
  - features/interpolate.feature
168
169
  - features/layout.feature
169
170
  - features/multiple_files.feature
171
+ - features/page_config.feature
170
172
  - features/reference.feature
171
173
  - features/removeduplicate.feature
172
174
  - features/repository.feature