jekyll-paginate-v2 1.3.2 → 1.3.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
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: d5a8ad5b12fdd974ec99c1a4d4aa6572ed754250
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: f7e5182bccff65e50de5588714262bb209d535e7
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: e1ab80baa20145544bcc08d665b9d628c8cc8f651503bccc615ad083a646fc5e6d1bc043cca5d635a7af8a951af789a164ca815a8cde4b4cc68932972f8dd2d7
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 4e8e4aeb771e3ab4b6f9b8ea4f08292e27caad0541be1b23f3fc2a6c4870a64d095c5fea94c1195131d8344eeb2ec6834d89d03f46f9e2c9b330e53b647e9a24
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -34,7 +34,7 @@ gem install jekyll-paginate-v2 
     | 
|
| 
       34 
34 
     | 
    
         | 
| 
       35 
35 
     | 
    
         
             
            Update your [_config.yml](#site-configuration) and [pages](#page-configuration).
         
     | 
| 
       36 
36 
     | 
    
         | 
| 
       37 
     | 
    
         
            -
            > Although fully backwards compatible, to enable the new features this gem needs slightly extended [site yml](#site-configuration) configuration and miniscule additional new front-matter for the [ 
     | 
| 
      
 37 
     | 
    
         
            +
            > Although fully backwards compatible, to enable the new features this gem needs slightly extended [site yml](#site-configuration) configuration and miniscule additional new front-matter for the [pages to paginate on](#page-configuration).
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
            Now you're ready to run `jekyll serve` and your paginated files should be generated.
         
     | 
| 
       40 
40 
     | 
    
         | 
| 
         @@ -73,7 +73,7 @@ pagination: 
     | 
|
| 
       73 
73 
     | 
    
         
             
              # The permalink structure for the paginated pages (this can be any level deep)
         
     | 
| 
       74 
74 
     | 
    
         
             
              permalink: '/page/:num/'
         
     | 
| 
       75 
75 
     | 
    
         | 
| 
       76 
     | 
    
         
            -
              # Optional additional suffix for the title of the paginated pages (the prefix is inherited from the  
     | 
| 
      
 76 
     | 
    
         
            +
              # Optional additional suffix for the title of the paginated pages (the prefix is inherited from the original page)
         
     | 
| 
       77 
77 
     | 
    
         
             
              title_suffix: ' - page :num'
         
     | 
| 
       78 
78 
     | 
    
         | 
| 
       79 
79 
     | 
    
         
             
              # Limit how many pagenated pages to create (default: 0, means all)
         
     | 
| 
         @@ -98,9 +98,15 @@ pagination: 
     | 
|
| 
       98 
98 
     | 
    
         
             
            ############################################################
         
     | 
| 
       99 
99 
     | 
    
         
             
            ```
         
     | 
| 
       100 
100 
     | 
    
         | 
| 
      
 101 
     | 
    
         
            +
            Also ensure that you remove the old 'jekyll-paginate' gem from your `gems` list and add this new gem instead
         
     | 
| 
      
 102 
     | 
    
         
            +
             
     | 
| 
      
 103 
     | 
    
         
            +
            ``` yml
         
     | 
| 
      
 104 
     | 
    
         
            +
            gems: [jekyll-paginate-v2]
         
     | 
| 
      
 105 
     | 
    
         
            +
            ```
         
     | 
| 
      
 106 
     | 
    
         
            +
             
     | 
| 
       101 
107 
     | 
    
         
             
            ## Page configuration
         
     | 
| 
       102 
108 
     | 
    
         | 
| 
       103 
     | 
    
         
            -
            To enable pagination on a page  
     | 
| 
      
 109 
     | 
    
         
            +
            To enable pagination on a page then simply include the minimal pagination configuration in the page front-matter:
         
     | 
| 
       104 
110 
     | 
    
         | 
| 
       105 
111 
     | 
    
         
             
            ``` yml
         
     | 
| 
       106 
112 
     | 
    
         
             
            ---
         
     | 
| 
         @@ -162,7 +168,7 @@ See more about the old style of pagination at the [jekyll-paginate](https://gith 
     | 
|
| 
       162 
168 
     | 
    
         | 
| 
       163 
169 
     | 
    
         
             
            ## Paginate categories, tags, locales
         
     | 
| 
       164 
170 
     | 
    
         | 
| 
       165 
     | 
    
         
            -
            Enabling pagination for specific categories, tags or locales is as simple as adding values to the pagination  
     | 
| 
      
 171 
     | 
    
         
            +
            Enabling pagination for specific categories, tags or locales is as simple as adding values to the pagination page front-matter and corresponding values in the posts.
         
     | 
| 
       166 
172 
     | 
    
         | 
| 
       167 
173 
     | 
    
         
             
            ### Filtering categories
         
     | 
| 
       168 
174 
     | 
    
         | 
| 
         @@ -247,7 +253,7 @@ pagination: 
     | 
|
| 
       247 
253 
     | 
    
         | 
| 
       248 
254 
     | 
    
         
             
            ## Configuration overrides
         
     | 
| 
       249 
255 
     | 
    
         | 
| 
       250 
     | 
    
         
            -
            All of the configuration elements from the `_config.yml` file can be overwritten in the pagination  
     | 
| 
      
 256 
     | 
    
         
            +
            All of the configuration elements from the `_config.yml` file can be overwritten in the pagination pages. E.g. if you want one category page to have different permalink structure simply override the item like so
         
     | 
| 
       251 
257 
     | 
    
         | 
| 
       252 
258 
     | 
    
         
             
            ``` yml
         
     | 
| 
       253 
259 
     | 
    
         
             
            pagination: 
         
     | 
| 
         @@ -256,7 +262,7 @@ pagination: 
     | 
|
| 
       256 
262 
     | 
    
         
             
              permalink: '/cars/:num/'
         
     | 
| 
       257 
263 
     | 
    
         
             
            ```
         
     | 
| 
       258 
264 
     | 
    
         | 
| 
       259 
     | 
    
         
            -
            Overriding sorting to sort by the post title in ascending order for another paginated  
     | 
| 
      
 265 
     | 
    
         
            +
            Overriding sorting to sort by the post title in ascending order for another paginated page could be done like so
         
     | 
| 
       260 
266 
     | 
    
         | 
| 
       261 
267 
     | 
    
         
             
            ``` yml
         
     | 
| 
       262 
268 
     | 
    
         
             
            pagination: 
         
     | 
| 
         @@ -270,10 +276,18 @@ pagination: 
     | 
|
| 
       270 
276 
     | 
    
         | 
| 
       271 
277 
     | 
    
         
             
            #### I'm getting a bundler error after upgrading the gem (Bundler::GemNotFound)
         
     | 
| 
       272 
278 
     | 
    
         | 
| 
       273 
     | 
    
         
            -
            > bundler/spec_set.rb:95:in `block in materialize': Could not find jekyll-paginate-v2-1.0.0 in any of the sources (Bundler::GemNotFound) 
     | 
| 
      
 279 
     | 
    
         
            +
            > bundler/spec_set.rb:95:in `block in materialize': Could not find jekyll-paginate-v2-1.0.0 in any of the sources (Bundler::GemNotFound)
         
     | 
| 
       274 
280 
     | 
    
         | 
| 
       275 
281 
     | 
    
         
             
            When running `jekyll serve` if you ever get an error similar to the one above the solution is to delete your `Gemfile.lock` file and try again.
         
     | 
| 
       276 
282 
     | 
    
         | 
| 
      
 283 
     | 
    
         
            +
            #### My pagination pages are not being found (Couldn't find any pagination page. Skipping pagination)
         
     | 
| 
      
 284 
     | 
    
         
            +
             
     | 
| 
      
 285 
     | 
    
         
            +
            > Pagination: Is enabled, but I couldn't find any pagination page. Skipping pagination...
         
     | 
| 
      
 286 
     | 
    
         
            +
             
     | 
| 
      
 287 
     | 
    
         
            +
            Pagination only works inside **pages** they are not supported in the liquid templates. Those are the files that live in the folders prefixed by the underscore (i.e. files under `_layouts/`, `_includes/`, `_posts/` etc ). 
         
     | 
| 
      
 288 
     | 
    
         
            +
             
     | 
| 
      
 289 
     | 
    
         
            +
            Create a normal page with a `layout:page` in it's front-matter and place the pagination logic there.
         
     | 
| 
      
 290 
     | 
    
         
            +
             
     | 
| 
       277 
291 
     | 
    
         
             
            ## Issues / to-be-completed
         
     | 
| 
       278 
292 
     | 
    
         
             
            * Incomplete unit-tests 
         
     | 
| 
       279 
293 
     | 
    
         
             
            * Missing integration tests [#2](https://github.com/jekyll/jekyll-paginate/pull/2)
         
     | 
| 
         @@ -28,7 +28,7 @@ module Jekyll 
     | 
|
| 
       28 
28 
     | 
    
         
             
                    if !site.config['paginate'].nil?
         
     | 
| 
       29 
29 
     | 
    
         
             
                      # You cannot run both the new code and the old code side by side
         
     | 
| 
       30 
30 
     | 
    
         
             
                      if !site.config['pagination'].nil?
         
     | 
| 
       31 
     | 
    
         
            -
                        err_msg = "The new jekyll-paginate-v2 and the old jekyll-paginate logic cannot both be configured in the site config at the same time. Please disable the old 'paginate: 
     | 
| 
      
 31 
     | 
    
         
            +
                        err_msg = "The new jekyll-paginate-v2 and the old jekyll-paginate logic cannot both be configured in the site config at the same time. Please disable the old 'paginate:' config settings."
         
     | 
| 
       32 
32 
     | 
    
         
             
                        Jekyll.logger.error err_msg 
         
     | 
| 
       33 
33 
     | 
    
         
             
                        raise ArgumentError.new(err_msg)
         
     | 
| 
       34 
34 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -7,9 +7,8 @@ module Jekyll 
     | 
|
| 
       7 
7 
     | 
    
         
             
                    # By default if pagination is enabled we attempt to find all index.html pages in the site
         
     | 
| 
       8 
8 
     | 
    
         
             
                    templates = self.discover_paginate_templates(site_pages)
         
     | 
| 
       9 
9 
     | 
    
         
             
                    if( templates.size.to_i <= 0 )
         
     | 
| 
       10 
     | 
    
         
            -
                      logging_lambda.call "Is enabled, but I couldn't find any pagination  
     | 
| 
       11 
     | 
    
         
            -
                      " 
     | 
| 
       12 
     | 
    
         
            -
                      "Templates must have 'paginate: enabled: true' in their front-matter.", "warn"
         
     | 
| 
      
 10 
     | 
    
         
            +
                      logging_lambda.call "Is enabled, but I couldn't find any pagination page. Skipping pagination. "+
         
     | 
| 
      
 11 
     | 
    
         
            +
                      "Pages must have 'paginate: enabled: true' in their front-matter for pagination to work.", "warn"
         
     | 
| 
       13 
12 
     | 
    
         
             
                      return
         
     | 
| 
       14 
13 
     | 
    
         
             
                    end
         
     | 
| 
       15 
14 
     | 
    
         | 
| 
         @@ -30,7 +29,7 @@ module Jekyll 
     | 
|
| 
       30 
29 
     | 
    
         
             
                        # requiring this makes the logic simpler as I don't need to determine which index pages 
         
     | 
| 
       31 
30 
     | 
    
         
             
                        # were generated automatically and which weren't
         
     | 
| 
       32 
31 
     | 
    
         
             
                        if( template_config['enabled'] )
         
     | 
| 
       33 
     | 
    
         
            -
                          logging_lambda.call "found  
     | 
| 
      
 32 
     | 
    
         
            +
                          logging_lambda.call "found page: "+template.path
         
     | 
| 
       34 
33 
     | 
    
         
             
                          # Now construct the pagination data for this template page
         
     | 
| 
       35 
34 
     | 
    
         
             
                          #self.paginate(site, template, template_config, all_posts, all_tags, all_categories, all_locales)
         
     | 
| 
       36 
35 
     | 
    
         
             
                          self.paginate(template, template_config, site_title, all_posts, all_tags, all_categories, all_locales, page_create_lambda, logging_lambda)
         
     | 
| 
         @@ -56,15 +55,15 @@ module Jekyll 
     | 
|
| 
       56 
55 
     | 
    
         
             
                      logging_lambda.call "Legacy pagination logic will stop working on Jan 1st 2018, update your configs before that time.", "warn"
         
     | 
| 
       57 
56 
     | 
    
         
             
                    else
         
     | 
| 
       58 
57 
     | 
    
         
             
                      logging_lambda.call "Detected legacy jekyll-paginate logic being run. "+
         
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
       60 
     | 
    
         
            -
             
     | 
| 
      
 58 
     | 
    
         
            +
                      "Please update your configs to use the new pagination logic. This compatibility function "+
         
     | 
| 
      
 59 
     | 
    
         
            +
                      "will stop working after Jan 1st 2018 and your site build will throw an error."
         
     | 
| 
       61 
60 
     | 
    
         
             
                    end
         
     | 
| 
       62 
61 
     | 
    
         | 
| 
       63 
62 
     | 
    
         
             
                    if template = CompatibilityUtils.template_page(site_pages, legacy_config['legacy_source'], legacy_config['permalink'])
         
     | 
| 
       64 
63 
     | 
    
         
             
                      CompatibilityUtils.paginate(legacy_config, all_posts, template, page_create_lambda, logging_lambda)
         
     | 
| 
       65 
64 
     | 
    
         
             
                    else
         
     | 
| 
       66 
65 
     | 
    
         
             
                      logging_lambda.call "Legacy pagination is enabled, but I couldn't find " +
         
     | 
| 
       67 
     | 
    
         
            -
                      "an index.html page to use as the pagination  
     | 
| 
      
 66 
     | 
    
         
            +
                      "an index.html page to use as the pagination page. Skipping pagination.", "warn"
         
     | 
| 
       68 
67 
     | 
    
         
             
                    end
         
     | 
| 
       69 
68 
     | 
    
         
             
                  end # function run_compatability (REMOVE AFTER 2018-01-01)
         
     | 
| 
       70 
69 
     | 
    
         | 
| 
         @@ -1,8 +1,8 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module Jekyll
         
     | 
| 
       2 
2 
     | 
    
         
             
              module PaginateV2
         
     | 
| 
       3 
     | 
    
         
            -
                VERSION = "1.3. 
     | 
| 
      
 3 
     | 
    
         
            +
                VERSION = "1.3.3"
         
     | 
| 
       4 
4 
     | 
    
         
             
                # When modifying remember to issue a new tag command in git before committing, then push the new tag
         
     | 
| 
       5 
     | 
    
         
            -
                # git tag -a v1.3. 
     | 
| 
      
 5 
     | 
    
         
            +
                # git tag -a v1.3.3 -m "Gem v1.3.3"
         
     | 
| 
       6 
6 
     | 
    
         
             
                # git push origin --tags
         
     | 
| 
       7 
7 
     | 
    
         
             
              end
         
     | 
| 
       8 
8 
     | 
    
         
             
            end
         
     |