bridgetown-paginate 0.21.0.beta3 → 0.21.0.beta4

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: 5e9bbb0482691a59cd093b423e8872cfe31dd79f8b14066c992168d92584e148
4
+ data.tar.gz: 9aceeaacc6a79e1b89b63e4549a1854f611d663482d801dbcdcd6d4c0958def9
5
5
  SHA512:
6
- metadata.gz: 9f2c7ac14bbce7ea881f45ecdbc4d4529a249e87bd7ac362673812a69297778a471b57160974cd04c5f0b1584551b8d627e5433df4f2adb4d9a985d9b5ac7035
7
- data.tar.gz: 8db063eaa00fe29d9eb368efa958b329765a4daf3fb5282b2abcb5ef9b862188ce0ea3f2503f44c733a1751290edcfd8e53ae48088505d8a9792ef4a2efd26a1
6
+ metadata.gz: 1cd91a7626d55b41f866f353f437f463dc6f58aa72e07184e77fb822116fb7d7f101ff17fc828aa823ede9c3f5d0c85e7b45b477ccb010096989b12d03bdf7e2
7
+ data.tar.gz: 3f2ffbfe3936a2e78f50963965af1eff53b10887fc04b019745e34d329cef2b7eb05f43db1c21c08b4e4da2016fbede212006e99dcbf9916e6e482707cfa3dc9
@@ -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.0.beta4
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-05-30 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.0.beta4
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.0.beta4
27
27
  description:
28
28
  email: maintainers@bridgetownrb.com
29
29
  executables: []