jekyll-strapi-mod 0.0.1 → 0.2.1

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: 4805d0acf6a5e4abe2f219d7c3bbc12a1749c916d8ab42ef0aaacbb7bc057302
4
- data.tar.gz: b38da0226c22140ac3d14004b9cdcce99db1e4de2987e762bec3f3ddff46cea7
3
+ metadata.gz: 841fae0aa7bdab043f27d0be66214af545f8ed657bdecabcbca8d413c381c989
4
+ data.tar.gz: 33919270f0c1ec6c58b55cfca446bc48644089beb0b3f35f5932300ff88245d5
5
5
  SHA512:
6
- metadata.gz: 2191c2952a48b43fd28d9791e7ece1f8db7fdd0714aa14dc50cf9de19f2bd7942c192fe17be34ac82ec811eee9f0948d40bb9570fbfc32c216e46dec666f400f
7
- data.tar.gz: e272ea6602bfb39e64c6c5202d7a97e1e7bac1e707c6712ad1a282c62b86fba8603b2ffeffde6210b5b089cbb2835a33e25864bcb9abe4684ae8770d0fe96f88
6
+ metadata.gz: 0f6a5ac7d4bc98357e64ffbce0bea9e2e28b808fab8b7267fa6abe92faaf0912e108827525ec853ed2d3f965d9091e088563be674f6ad5697e1bab5cfc02be93
7
+ data.tar.gz: d346859c123788de04feceb54c7e9349385130e95c63799796e7b6e2f909a819f45007dcba00c95c40b95389aad8bd08f9c56557a43f5edb134a1325456b9b07
data/README.md CHANGED
@@ -21,12 +21,14 @@ plugins:
21
21
 
22
22
  ```yaml
23
23
  strapi:
24
- # Your API endpoint (optional, default to http://localhost:1337)
24
+ # Your API endpoint (optional, default to http://localhost:1337/api)
25
25
  endpoint: http://localhost:1337/api
26
+ # Your REST API endpoint query string to specify a parameter for example http://localhost:1337/api/posts?populate=%2A (optional, default to populate=*)
27
+ parameter: populate=*
26
28
  # Collections, key is used to access in the strapi.collections
27
29
  # template variable
28
30
  collections:
29
- # Example for a "articles" collection
31
+ # Example for an "articles" collection
30
32
  articles:
31
33
  # Collection name (optional)
32
34
  type: article
@@ -19,7 +19,7 @@ module Jekyll
19
19
 
20
20
  def each
21
21
  # Initialize the HTTP query
22
- path = "/#{@config['type'] || @collection_name}?_limit=10000"
22
+ path = "/#{@config['type'] || @collection_name}?_limit=10000#{@site.parameter}"
23
23
  uri = URI("#{@site.endpoint}#{path}")
24
24
  Jekyll.logger.info "Jekyll Strapi:", "Fetching entries from #{uri}"
25
25
  # Get entries
@@ -19,7 +19,11 @@ module Jekyll
19
19
  end
20
20
 
21
21
  def endpoint
22
- has_strapi? and @config['strapi']['endpoint'] or "http://localhost:1337"
22
+ has_strapi? and @config['strapi']['endpoint'] or "http://localhost:1337/api"
23
+ end
24
+
25
+ def parameter
26
+ has_strapi? and @config['strapi']['parameter'] or "populate=*"
23
27
  end
24
28
 
25
29
  def strapi_link_resolver(collection = nil, document = nil)
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Strapi
3
- VERSION = "0.0.1"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-strapi-mod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - marktawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-29 00:00:00.000000000 Z
11
+ date: 2022-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -52,7 +52,8 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.1'
55
- description: " A Jekyll plugin for retrieving content from a Strapi API\n"
55
+ description: " A Jekyll plugin for retrieving content from a Strapi API. Works
56
+ with Strapi v4\n"
56
57
  email:
57
58
  - markmunyaka@gmail.com
58
59
  executables: []