bridgetown-paginate 0.21.0.beta2 → 0.21.1

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: 8384ce6839b5e3831fc17c242587d38a193c8971d3d048123b017467f2ecadaf
4
- data.tar.gz: 0a0c85cd602469c1fdc1784e52a012c022b269afb265fd05c45969954da2074b
3
+ metadata.gz: 73658b671ce99dcb98aaac7ed5cae7b2d00be40cba39cdfb5c2736a802028c05
4
+ data.tar.gz: 49a274756b395c33b7645420de58d1bf9ae2192021937b8b47253d295d231d09
5
5
  SHA512:
6
- metadata.gz: 74f3cc60cf66d90bac4244add894e373cbe3ff23ee2fb975273d76280a16c3775e38e0cd29297a7acc32d615965e52ff8d3e181f35181b3407193da5b91acbf2
7
- data.tar.gz: fd57a38ac98898dec45e158fe0e872767943f7e5a23534c98ad5f91cbc5502038de7e78babea2e938297959511e5df1290027ed2a55b2ab764ad9303407d9c98
6
+ metadata.gz: 0cc12d7f28da3ebe4fd35564d747e5d0c23ab85e5694bfd62e813448207824cf37de3a9c2180ea5430975e3df7ff2de94b65b9d36246fb070ae63c82fa5ef1db
7
+ data.tar.gz: 83e2e18c1b007f730fc8e8e984ed9b831f84866a413672c6c2986be4cd34af754acb32d2cbda78188aee29ceafd42a283f14c7c6cc5b82cf763b167b6dd36378
@@ -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.beta2
4
+ version: 0.21.1
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-09 00:00:00.000000000 Z
11
+ date: 2021-07-19 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.beta2
19
+ version: 0.21.1
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.beta2
26
+ version: 0.21.1
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: