jekyll-strapi-4 1.0.8 → 1.0.12
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 +4 -4
- data/README.md +16 -1
- data/lib/jekyll/strapi4/collection.rb +11 -3
- data/lib/jekyll/strapi4/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11f2413b8ff5e498215c24ff334e01387486d45a2df93fe293285ec1b5448da3
|
4
|
+
data.tar.gz: 470884035a4e77436279b59816da00fe13464a36b705b1b0520c87024335aeab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fe26d4fa4d8b654676b84e54bfd66aa10e779e0b2a93ca61282d8caa03d3d1732681aca69e38ff8bfa2e936cd2b74727c02ef996b82138dcec4b04c07e1f21c
|
7
|
+
data.tar.gz: 5a6111df4ee89bb3c80208c90e5e5739f05ffd71d2fe2df5cd1a5cb1cdcf274e39a0baecfe6714526f232cc5b0e4257bc0051b4695d85aa9a70c6c23507b8927
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# jekyll-strapi-4
|
2
2
|
|
3
|
-
This plugin is based on
|
3
|
+
This plugin works with Strapi 4 and is based on [jekyll-strapi](https://github.com/strapi-community/jekyll-strapi/tree/v0.1.2) plugin for Strapi 3.
|
4
4
|
|
5
5
|

|
6
6
|
|
@@ -58,6 +58,8 @@ strapi:
|
|
58
58
|
# populate: "*"
|
59
59
|
# Layout file for this collection
|
60
60
|
layout: photo.html
|
61
|
+
# Single request for collection, default false
|
62
|
+
single_request: true
|
61
63
|
# Generate output files or not (default: false)
|
62
64
|
output: true
|
63
65
|
```
|
@@ -140,6 +142,19 @@ module Jekyll
|
|
140
142
|
end
|
141
143
|
```
|
142
144
|
|
145
|
+
### Single request
|
146
|
+
|
147
|
+
When you request for a collection it makes a collection request and collection resources request. When you have a small collection like testimonials you might not make n+1 requests but only one. In that case use single_request: true in your _config file.
|
148
|
+
|
149
|
+
```yaml
|
150
|
+
strapi:
|
151
|
+
collections:
|
152
|
+
photos:
|
153
|
+
single_request: true
|
154
|
+
```
|
155
|
+
|
156
|
+
You can always add to your parameters populate parameter to get additional data in your collection request.
|
157
|
+
|
143
158
|
### Permalinks
|
144
159
|
|
145
160
|
When you have a multi-language content, you might want generate a proper url based on different patterns, for example:
|
@@ -48,9 +48,13 @@ module Jekyll
|
|
48
48
|
document.type = collection_name
|
49
49
|
document.collection = collection_name
|
50
50
|
document.id ||= document._id
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
if single_request?
|
52
|
+
document.strapi_attributes = document.attributes
|
53
|
+
else
|
54
|
+
document_response = get_document(document.id)
|
55
|
+
# We will keep all the attributes in strapi_attributes
|
56
|
+
document.strapi_attributes = document_response['data']["attributes"]
|
57
|
+
end
|
54
58
|
document.url = @site.strapi_link_resolver(collection_name, document)
|
55
59
|
end
|
56
60
|
data.each {|x| yield(x)}
|
@@ -89,6 +93,10 @@ module Jekyll
|
|
89
93
|
return_params ? string : ""
|
90
94
|
end
|
91
95
|
|
96
|
+
def single_request?
|
97
|
+
@config["single_request"] == true
|
98
|
+
end
|
99
|
+
|
92
100
|
def custom_path_params
|
93
101
|
# Define custom logic in your _plugins/file_name.rb
|
94
102
|
""
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-strapi-4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Strapi Solutions
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-
|
13
|
+
date: 2022-09-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: down
|
@@ -99,7 +99,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
99
|
requirements:
|
100
100
|
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version:
|
102
|
+
version: 3.0.0
|
103
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
104
|
requirements:
|
105
105
|
- - ">="
|