bridgetown-paginate 0.21.0.beta3 → 0.21.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: 0e69ff78c2985a922c13d4d05257bffedea3684f43bf5f68e692ab4c7b3a2d81
4
- data.tar.gz: 429968e2814f8e872ff106ee3080025ab7fc656151af2e4bce9d5eccbedfcf75
3
+ metadata.gz: 45369a416f343109e2bdc1ffe5a67996100127813567b0874c207dd10ff86282
4
+ data.tar.gz: a7ef8b903febea7709b7e7af642e98b454bf464a50acc7f2a6c09f068d5b8431
5
5
  SHA512:
6
- metadata.gz: 9f2c7ac14bbce7ea881f45ecdbc4d4529a249e87bd7ac362673812a69297778a471b57160974cd04c5f0b1584551b8d627e5433df4f2adb4d9a985d9b5ac7035
7
- data.tar.gz: 8db063eaa00fe29d9eb368efa958b329765a4daf3fb5282b2abcb5ef9b862188ce0ea3f2503f44c733a1751290edcfd8e53ae48088505d8a9792ef4a2efd26a1
6
+ metadata.gz: 0b719ca33f468ee9f8ba22d372c96810076d6b729d96f0e95bcdd0efad982ec9a168c0c9026c5b6556d77826ac684441a5759a84afd4b45b55acc9cc3ab80e84
7
+ data.tar.gz: 1347ab6fb4fa5ab2ee4fceed385fbf5feb03b7d536556bb300d146397aef37656de164f7f6d066355265a338564c7b5c675344d40464d8edb266d9c982818815
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Handles Legacy Pages
3
+ # Handles Generated Pages
4
4
  Bridgetown::Hooks.register :pages, :post_init, reloadable: false do |page|
5
5
  if page.class != Bridgetown::Paginate::PaginationPage &&
6
6
  page.site.config.dig("pagination", "enabled")
@@ -21,3 +21,8 @@ Bridgetown::Hooks.register :resources, :post_read, reloadable: false do |page|
21
21
  Bridgetown::Paginate::PaginationGenerator.add_matching_template(page)
22
22
  end
23
23
  end
24
+
25
+ # Ensure sites clear out templates before rebuild
26
+ Bridgetown::Hooks.register :site, :after_reset, reloadable: false do |_site|
27
+ Bridgetown::Paginate::PaginationGenerator.matching_templates.clear
28
+ end
@@ -13,14 +13,13 @@ module Bridgetown
13
13
  # This generator should be passive with regard to its execution
14
14
  priority :lowest
15
15
 
16
- @matching_templates = []
17
-
18
- def self.add_matching_template(template)
19
- @matching_templates << template
16
+ # @return [Set<Bridgetown::Page, Bridgetown::Resource::Base>]
17
+ def self.matching_templates
18
+ @matching_templates ||= Set.new
20
19
  end
21
20
 
22
- class << self
23
- attr_reader :matching_templates
21
+ def self.add_matching_template(template)
22
+ matching_templates << template
24
23
  end
25
24
 
26
25
  # Generate paginated pages if necessary (Default entry point)
@@ -47,7 +46,7 @@ module Bridgetown
47
46
  # Get all matching pages in the site found by the init hooks, and ensure they're
48
47
  # still in the site.pages array
49
48
  templates = self.class.matching_templates.select do |page|
50
- site.pages.include?(page) || site.resources.include?(page)
49
+ site.generated_pages.include?(page) || site.resources.include?(page)
51
50
  end
52
51
 
53
52
  # Get the default title of the site (used as backup when there is no
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-paginate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0.beta3
4
+ version: 0.21.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-15 00:00:00.000000000 Z
11
+ date: 2021-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.21.0.beta3
19
+ version: 0.21.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.21.0.beta3
26
+ version: 0.21.2
27
27
  description:
28
28
  email: maintainers@bridgetownrb.com
29
29
  executables: []
@@ -57,9 +57,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
57
57
  version: '0'
58
58
  required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ">"
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 1.3.1
62
+ version: '0'
63
63
  requirements: []
64
64
  rubygems_version: 3.1.4
65
65
  signing_key: