bridgetown-paginate 1.0.0.beta2 → 1.1.0.beta1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8d7266c5e0dc1ca064eb708a40837bdc7d2b3ae8110271578e94f47a686f7f4
|
4
|
+
data.tar.gz: 4a83ea0e7bd905b8dfeaa04275bf0fda96a8fd01ca8b9e4f0cad9af56980a32e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f7a48a98d34b3f12e45256268186c36199eabaa29ea771a23201d4423d8caf73d85043140c86ded5ad3f33120f5d057842aefe7ef4841710b3c0ccde92e3f04
|
7
|
+
data.tar.gz: 785620faeb604237353ab31793a7dac6c645fad9c9897a43d5cfdb5b50f5bb291342a4f38d94c227deb055a735f4c2900c6f712db9f45372787c0d57ef691701
|
@@ -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)
|
@@ -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
|
@@ -366,18 +371,7 @@ module Bridgetown
|
|
366
371
|
index_page_ext
|
367
372
|
)
|
368
373
|
|
369
|
-
|
370
|
-
# that are defined in the template page before
|
371
|
-
if newpage.paginator.page_path.end_with? "/"
|
372
|
-
newpage.set_url(File.join(newpage.paginator.page_path, index_page_with_ext))
|
373
|
-
elsif newpage.paginator.page_path.end_with? index_page_ext.to_s
|
374
|
-
# Support for direct .html files
|
375
|
-
newpage.set_url(newpage.paginator.page_path)
|
376
|
-
else
|
377
|
-
# Support for extensionless permalinks
|
378
|
-
newpage.set_url(newpage.paginator.page_path + index_page_ext.to_s)
|
379
|
-
end
|
380
|
-
|
374
|
+
newpage.set_url(newpage.paginator.page_path)
|
381
375
|
newpage.data["permalink"] = newpage.paginator.page_path if template.data["permalink"]
|
382
376
|
|
383
377
|
# Transfer the title across to the new page
|
@@ -34,10 +34,19 @@ module Bridgetown
|
|
34
34
|
# rubocop:disable Naming/AccessorMethodName
|
35
35
|
def set_url(url_value)
|
36
36
|
@path = url_value.delete_prefix "/"
|
37
|
-
@dir
|
37
|
+
@dir = @path.ends_with?("/") ? @path : File.dirname(@path)
|
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
|
@@ -42,8 +42,8 @@ module Bridgetown
|
|
42
42
|
# Ensure that the current page has correct extensions if needed
|
43
43
|
this_page_url = Utils.ensure_full_path(
|
44
44
|
@page == 1 ? first_index_page_url : paginated_page_url,
|
45
|
-
|
46
|
-
|
45
|
+
default_indexpage || "",
|
46
|
+
default_ext || ""
|
47
47
|
)
|
48
48
|
|
49
49
|
# To support customizable pagination pages we attempt to explicitly
|
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.
|
4
|
+
version: 1.1.0.beta1
|
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-
|
11
|
+
date: 2022-06-02 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.
|
19
|
+
version: 1.1.0.beta1
|
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.
|
26
|
+
version: 1.1.0.beta1
|
27
27
|
description:
|
28
28
|
email: maintainers@bridgetownrb.com
|
29
29
|
executables: []
|