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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4741de9146f0c6a3fe4cd8dfdca5cd16f8b80a25c8cf7d88b5ba26a378355bc
4
- data.tar.gz: 9ca92dd5c261ab6675c9a69bc6b2ce8aebc698034917d0c5d25bab2b7385e090
3
+ metadata.gz: 2311ee5e15d9cab7cd7cd04746afd03d17a85982e2cc43cdadcc25ffba3646cb
4
+ data.tar.gz: 2cce7fa9fe95891b1559968d5e3d1c139752182966160a1fa6ac44933a6b36d3
5
5
  SHA512:
6
- metadata.gz: 219393a1e55ec8b54cbac9f5cd7c0204fb92473de954b2121e9c1e097606877b51aa51509e11a51d8113fefd00d7b9cfbf318aa69be71030ba553a6c989ade9c
7
- data.tar.gz: bf136dfa698341ef8eacd7caf515f2612eab08ee4ae02ba07b17931dd3cfbbdde35f2169eef74eb40f27186e4c4c8b415b955d1dc8e495bfe730b3e5b262c15c
6
+ metadata.gz: 8aa565c2c68cb96330213ace4efcd99a31948aa7349594004de99018dc9195518ce6620e97f4e6f578d8def0354f4b2519e92f5128b1a57cb6179948f1f3900f
7
+ data.tar.gz: 91b5f0df720865f92c388a27b2613dfeeed7c4b95190d2dd56699eaec6719f0c495be02f5ccd7504c748615ba7ca41851dd8d437aff089d84f4268712c48d8fd
@@ -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", <<~RUBY
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
- init :bridgetown_directus do
14
- api_url "#{api_url}"
15
- token "#{auth_token.present? ? auth_token : "<%= ENV['DIRECTUS_AUTH_TOKEN'] %>"}"
16
-
17
- # Field Mappings (Ensure your Directus collection has these fields)
18
- mappings do
19
- title "title" # Required field
20
- content "content" # Required field
21
- slug "slug" # Optional, will be auto-generated if not provided
22
- date "date" # Optional, defaults to the current date/time if not provided
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
- end
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"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgetownDirectus
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
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.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-12 00:00:00.000000000 Z
11
+ date: 2024-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown