bridgetown-paginate 0.21.1 → 0.21.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bridgetown-paginate/pagination_model.rb +10 -3
- data/lib/bridgetown-paginate/utils.rb +11 -15
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fddc65d512f16a9c2e26b6c4fdc95d78b4ea849e1c0650f2d84cd42a17dabeed
|
4
|
+
data.tar.gz: 1496ce50a2078891bae86bf8ba4a675cc98a9b5529c49420c6f488ff64072f2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b461e2e1b829405e063e2bba612c98d0ce5d467029f3ad9b415f9510c9822474ca5bfa51b431206785ca29e35d457e7c63beb4976e9c6ae677625b33ad88839
|
7
|
+
data.tar.gz: a30e45d0c1d3727d849974d13dd17f2addbdeb1bc089e72904122813e6caa2abf8579a354d2b34f82f5cecea77abdce842c1eada389ed3efb9ccff3ab114af86
|
@@ -50,13 +50,18 @@ module Bridgetown
|
|
50
50
|
template_config = Bridgetown::Utils.deep_merge_hashes(
|
51
51
|
default_config,
|
52
52
|
template.data["pagination"] || template.data["paginate"] || {}
|
53
|
-
)
|
53
|
+
).tap do |config|
|
54
|
+
config["collection"] = config["collection"].to_s if config["collection"].is_a?(Symbol)
|
55
|
+
config["category"] = config["category"].to_s if config["category"].is_a?(Symbol)
|
56
|
+
config["tag"] = config["tag"].to_s if config["tag"].is_a?(Symbol)
|
57
|
+
config["locale"] = config["locale"].to_s if config["locale"].is_a?(Symbol)
|
58
|
+
end
|
54
59
|
|
55
60
|
# Is debugging enabled on the page level
|
56
61
|
@debug = template_config["debug"]
|
57
62
|
_debug_print_config_info(template_config, template.path)
|
58
63
|
|
59
|
-
next
|
64
|
+
next unless template_config["enabled"]
|
60
65
|
|
61
66
|
@logging_lambda.call "found page: " + template.path, "debug" unless @debug
|
62
67
|
|
@@ -340,7 +345,9 @@ module Bridgetown
|
|
340
345
|
else
|
341
346
|
template.dir
|
342
347
|
end
|
343
|
-
first_index_page_url = Utils.ensure_trailing_slash(
|
348
|
+
first_index_page_url = Utils.ensure_trailing_slash(
|
349
|
+
Utils.remove_double_slash(first_index_page_url)
|
350
|
+
)
|
344
351
|
paginated_page_url = File.join(first_index_page_url, paginated_page_url)
|
345
352
|
|
346
353
|
# 3. Create the paginator logic for this page, pass in the prev and next
|
@@ -36,9 +36,8 @@ module Bridgetown
|
|
36
36
|
# If the input already has a dot in position zero, it will be
|
37
37
|
# returned unchanged.
|
38
38
|
#
|
39
|
-
# path
|
40
|
-
#
|
41
|
-
# Returns the path with a leading slash
|
39
|
+
# @param path [String]
|
40
|
+
# @return [String] the path with a leading slash
|
42
41
|
def self.ensure_leading_dot(path)
|
43
42
|
path[0..0] == "." ? path : ".#{path}"
|
44
43
|
end
|
@@ -47,29 +46,26 @@ module Bridgetown
|
|
47
46
|
# If the input already has a forward slash in position zero, it will be
|
48
47
|
# returned unchanged.
|
49
48
|
#
|
50
|
-
# path
|
51
|
-
#
|
52
|
-
# Returns the path with a leading slash
|
49
|
+
# @param path [String]
|
50
|
+
# @return [String] the path with a leading slash
|
53
51
|
def self.ensure_leading_slash(path)
|
54
52
|
path[0..0] == "/" ? path : "/#{path}"
|
55
53
|
end
|
56
54
|
|
57
|
-
# Static: Return a String version of the input
|
55
|
+
# Static: Return a String version of the input with only one leading slash.
|
58
56
|
#
|
59
|
-
# path
|
60
|
-
#
|
61
|
-
|
62
|
-
|
63
|
-
path[0..0] == "/" ? path[1..-1] : path
|
57
|
+
# @param path [String]
|
58
|
+
# @return [String] the input without the leading slash
|
59
|
+
def self.remove_double_slash(path)
|
60
|
+
path[0..1] == "//" ? path[1..-1] : path
|
64
61
|
end
|
65
62
|
|
66
63
|
# Static: Return a String version of the input which has a trailing slash.
|
67
64
|
# If the input already has a forward slash at the end, it will be
|
68
65
|
# returned unchanged.
|
69
66
|
#
|
70
|
-
# path
|
71
|
-
#
|
72
|
-
# Returns the path with a trailing slash
|
67
|
+
# @param path [String]
|
68
|
+
# @return [String] the path with a trailing slash
|
73
69
|
def self.ensure_trailing_slash(path)
|
74
70
|
path[-1] == "/" ? path : "#{path}/"
|
75
71
|
end
|
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.
|
4
|
+
version: 0.21.5
|
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-
|
11
|
+
date: 2021-10-20 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.
|
19
|
+
version: 0.21.5
|
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.
|
26
|
+
version: 0.21.5
|
27
27
|
description:
|
28
28
|
email: maintainers@bridgetownrb.com
|
29
29
|
executables: []
|