bridgetown-paginate 1.0.0 → 1.1.0.beta3

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
  SHA256:
3
- metadata.gz: fd80c11ef16fed5c96abe33b21af69f82bc7497342d269314ca8c9bd6db7b1bb
4
- data.tar.gz: 808d8dad4b55f0c93a874542c1fa7540c1d7b6c6389c9905c17fda333f319db2
3
+ metadata.gz: 3cec767f60158855c156cabd8c95add74230811265af4f01653b3400f60c5d5a
4
+ data.tar.gz: eb5c56adfa80a672dd6e1faa7fac505c87d18d5d589e27e120e704e9d9c15e9c
5
5
  SHA512:
6
- metadata.gz: f69ff99f1a614245be8d04352759d2d81990e12570c80d72723c14339b64020ffd99e9bcb02b6392d8fe19b971e69c5fd672c3fabfac9cd3b62f891bf4b5eca9
7
- data.tar.gz: 1c3dfc941f74f43bb0dd31c71fca119beaffcad6804c7c986a4080a8ab8582a2c393e60648c548b6543233364d731f2a284886066fbd426b3deeab17ff126c1f
6
+ metadata.gz: edf1da239c4eed043279d46e936c9be96f8dc9d998a8fffea6a50b08440d0dbae2a5160d7e9f3c3b6b50d08f1c6acbf7f3d2da1f48d2efe1c545e119f0739531
7
+ data.tar.gz: 5caccdd573200bad1e96aae7639823415d97ef4db07acd5bfd8e993485b2cc190b53259c50ade8112bc28afdea75b10d85944da75b86c741dfe80ccfb97624b1
@@ -35,8 +35,8 @@ module Bridgetown
35
35
 
36
36
  # If disabled then simply quit
37
37
  unless default_config["enabled"]
38
- Bridgetown.logger.info "Pagination:", "disabled. Enable in site config" \
39
- " with pagination:\\n enabled: true"
38
+ Bridgetown.logger.info "Pagination:", "disabled. Enable in site config " \
39
+ "with pagination:\\n enabled: true"
40
40
  return
41
41
  end
42
42
 
@@ -41,7 +41,7 @@ module Bridgetown
41
41
  document_data = document.data[index_key]
42
42
  document_data = document_data.split(%r!;|,!) if document_data.is_a?(String)
43
43
 
44
- document_data.each do |key|
44
+ Array(document_data).each do |key|
45
45
  key = key.to_s.downcase.strip
46
46
  # If the key is a delimetered list of values
47
47
  # (meaning the user didn't use an array but a string with commas)
@@ -33,8 +33,8 @@ module Bridgetown
33
33
  def run(default_config, templates, site_title) # rubocop:todo Metrics/AbcSize
34
34
  if templates.size.to_i <= 0
35
35
  @logging_lambda.call(
36
- "is enabled in the config, but no paginated pages found." \
37
- " Add 'pagination:\\n collection: <label>' to the front-matter of a page.",
36
+ "is enabled in the config, but no paginated pages found. " \
37
+ "Add 'pagination:\\n collection: <label>' to the front-matter of a page.",
38
38
  "warn"
39
39
  )
40
40
  return
@@ -66,6 +66,11 @@ module Bridgetown
66
66
 
67
67
  next unless template_config["enabled"]
68
68
 
69
+ if template.site.config.available_locales.size > 1 && !template_config["locale"]
70
+ template_config["locale"] =
71
+ template.data["locale"].to_s
72
+ end
73
+
69
74
  @logging_lambda.call "found page: #{template.path}", "debug" unless @debug
70
75
 
71
76
  # Request all documents in all collections that the user has requested
@@ -38,6 +38,15 @@ module Bridgetown
38
38
  @url = url_value
39
39
  end
40
40
  # rubocop:enable Naming/AccessorMethodName
41
+
42
+ def destination(dest)
43
+ path = site.in_dest_dir(
44
+ dest, URL.unescape_path(url).delete_prefix(site.base_path(strip_slash_only: true))
45
+ )
46
+ path = File.join(path, "index") if url.end_with?("/")
47
+ path << output_ext unless path.end_with? output_ext
48
+ path
49
+ end
41
50
  end
42
51
  end
43
52
  end
@@ -28,8 +28,8 @@ module Bridgetown
28
28
  @total_pages = num_pages
29
29
 
30
30
  if @page > @total_pages
31
- raise "page number can't be greater than total pages:" \
32
- " #{@page} > #{@total_pages}"
31
+ raise "page number can't be greater than total pages: " \
32
+ "#{@page} > #{@total_pages}"
33
33
  end
34
34
 
35
35
  init = (@page - 1) * @per_page
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: 1.0.0
4
+ version: 1.1.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-07 00:00:00.000000000 Z
11
+ date: 2022-06-28 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: 1.0.0
19
+ version: 1.1.0.beta3
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: 1.0.0
26
+ version: 1.1.0.beta3
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: '0'
62
+ version: 1.3.1
63
63
  requirements: []
64
64
  rubygems_version: 3.1.4
65
65
  signing_key: