bridgetown_directus 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bridgetown.automation.rb +22 -19
- data/lib/bridgetown_directus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2311ee5e15d9cab7cd7cd04746afd03d17a85982e2cc43cdadcc25ffba3646cb
|
4
|
+
data.tar.gz: 2cce7fa9fe95891b1559968d5e3d1c139752182966160a1fa6ac44933a6b36d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8aa565c2c68cb96330213ace4efcd99a31948aa7349594004de99018dc9195518ce6620e97f4e6f578d8def0354f4b2519e92f5128b1a57cb6179948f1f3900f
|
7
|
+
data.tar.gz: 91b5f0df720865f92c388a27b2613dfeeed7c4b95190d2dd56699eaec6719f0c495be02f5ccd7504c748615ba7ca41851dd8d437aff089d84f4268712c48d8fd
|
data/bridgetown.automation.rb
CHANGED
@@ -1,33 +1,36 @@
|
|
1
1
|
say_status :directus, "Installing the bridgetown_directus plugin..."
|
2
2
|
|
3
3
|
# Prompt the user for Directus API URL and Auth Token
|
4
|
-
api_url = ask("What's your Directus instance URL?")
|
4
|
+
api_url = ask("What's your Directus instance URL? (Example: https://your-instance.example.com)")
|
5
5
|
auth_token = ask("What's your Directus API auth token? (Leave blank to use ENV['DIRECTUS_AUTH_TOKEN'])")
|
6
|
+
collection = ask("What's the name of the collection? (Example: posts")
|
6
7
|
|
7
8
|
# Add the bridgetown_directus gem
|
8
9
|
add_gem "bridgetown_directus"
|
9
10
|
|
10
11
|
# Add Directus configuration to config/initializers.rb using add_initializer method
|
11
|
-
add_initializer "bridgetown_directus"
|
12
|
+
add_initializer :"bridgetown_directus" do
|
13
|
+
<<~RUBY
|
14
|
+
do
|
15
|
+
api_url "#{api_url}"
|
16
|
+
token "#{auth_token.present? ? auth_token : "<%= ENV['DIRECTUS_AUTH_TOKEN'] %>"}"
|
17
|
+
collection "#{collection}"
|
12
18
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
category "category" # Optional
|
24
|
-
excerpt "excerpt" # Optional, defaults to content excerpt if not provided
|
25
|
-
image "image" # Optional, URL for the image associated with the post
|
19
|
+
# Field Mappings (Ensure your Directus collection has these fields)
|
20
|
+
mappings do
|
21
|
+
title "title" # Required field
|
22
|
+
content "content" # Required field
|
23
|
+
slug "slug" # Optional, will be auto-generated if not provided
|
24
|
+
date "date" # Optional, defaults to the current date/time if not provided
|
25
|
+
category "category" # Optional
|
26
|
+
excerpt "excerpt" # Optional, defaults to content excerpt if not provided
|
27
|
+
image "image" # Optional, URL for the image associated with the post
|
28
|
+
end
|
26
29
|
end
|
27
|
-
|
28
|
-
|
29
|
-
RUBY
|
30
|
-
|
30
|
+
RUBY
|
31
|
+
end
|
31
32
|
# Success message
|
32
33
|
say_status :directus, "Directus integration is complete! Please make sure your Directus collection contains the required fields as specified in the initializer."
|
33
34
|
say_status :directus, "Check config/initializers.rb for your Directus setup and adjust mappings if necessary."
|
35
|
+
say_status :directus, "For usage help visit:"
|
36
|
+
say_status :directus, "https://github.com/Munkun-Estudio/bridgetown_directus/blob/main/README.md"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bridgetown_directus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Munkun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bridgetown
|