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 +4 -4
 - data/README.md +1 -1
 - data/features/details.feature +3 -3
 - data/features/page_config.feature +42 -0
 - data/lib/jekyll/scholar/generators/details.rb +1 -1
 - data/lib/jekyll/scholar/utilities.rb +18 -12
 - data/lib/jekyll/scholar/version.rb +1 -1
 - metadata +4 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 7d41078acb5e68890960f62592839d27cf1fac7d305f41dac27fedf556f1c62d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 5a00d7a0c00455a47ccd56b0e9584bdf16811baf4a90f126c05de1b02de975ee
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: f9fafa23f51a0e6790e547271ec26707455beacdfddac3780a83cbd06af5bd6ab42aae3f4a056f3c44323d93758a8c6dc3f4b6f01762f9fea311b4c05b8fa45c
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: f9682cccf0b8bea4248b56702dc0e6349b5e5dfcfc074319bfa88bddfc1de2a841f7c49ec57e895dbb747e5c8e04e0600739cb67b2cc299d239904dc593d2794
         
     | 
    
        data/README.md
    CHANGED
    
    
    
        data/features/details.feature
    CHANGED
    
    | 
         @@ -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/ 
     | 
| 
       442 
     | 
    
         
            -
                And the "_site/ 
     | 
| 
      
 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 
     | 
    
         
            +
             
     | 
| 
         @@ -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 
     | 
| 
       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 
     | 
    
         
            -
             
     | 
| 
       632 
     | 
    
         
            -
                    #  
     | 
| 
      
 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 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         
            -
                     
     | 
| 
       645 
     | 
    
         
            -
             
     | 
| 
       646 
     | 
    
         
            -
                       
     | 
| 
       647 
     | 
    
         
            -
             
     | 
| 
       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 
     | 
| 
      
 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 
     | 
    
         | 
    
        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. 
     | 
| 
      
 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- 
     | 
| 
      
 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
         
     |