bridgetown-cloudinary 1.0.2 → 1.1.0

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: e6d7e24946102ae505543dbe416bafb395a4b1a8d53308707c741f75777590b6
4
- data.tar.gz: 79c0bc7fcb5dd359939b8e109611c637a5979d6a3bfa8b536578f397954efd73
3
+ metadata.gz: 366f2d5d3354c186045ea89968b96df7bce677b391990e864ba355f1181e9386
4
+ data.tar.gz: 72de912532f48ede11a53676cb3b0f333a88cf7025f8d163a88501b91b827788
5
5
  SHA512:
6
- metadata.gz: b85643e326348b828e9f361e60ac8dcf0ab6afd606f18579c20f3b36361216ed25d19e675c8649d7691f8214b4b9775e22bc9e2f1d7c1d26cb375b483d4a159e
7
- data.tar.gz: 29b8721731cbf6de3a61961d50f283d5c382f18c17891327c19ed73cd425b157e756e85d8a292b4dc9c502d00fc1d0bd1981a5f3edd132f5254c3662e8f0181a
6
+ metadata.gz: 870607b637392b2d753fa705eba71808e6965acb032854c24b4d3beb47c606f88d1edaee07aa335c013ccc63b384835344a1707e527beb7f47a17fec0998bf80
7
+ data.tar.gz: 1f7515d6c563cf488d47f55ae18effdfb781c60fd62f568bb377cd22b84ff6723d8290162a6c36e95c1ff839813bf17cb3b635a5c7a46f02a9d0051c79f2c6e4
@@ -0,0 +1 @@
1
+ *.md
@@ -1,5 +1,13 @@
1
1
  # master
2
2
 
3
+ # 1.1.0 / 2020-09-19
4
+
5
+ * Add helper support for Ruby-based templates (requires Bridgetown 0.17)
6
+
7
+ # 1.0.2 / 2020-05-21
8
+
9
+ * Escape tag attributes with `xml_escape`
10
+
3
11
  # 1.0.1 / 2020-05-21
4
12
 
5
13
  * Support page/local variables in alt text for tag as well
data/README.md CHANGED
@@ -15,16 +15,16 @@ images in Cloudinary directly, not your repo._)
15
15
 
16
16
  ## Installation
17
17
 
18
- Run this command to add this plugin to your site's Gemfile:
18
+ If you're running Bridgetown v0.15 or later, you can install this plugin via an automation to guide you through the configuration:
19
19
 
20
20
  ```shell
21
- $ bundle add bridgetown-cloudinary -g bridgetown_plugins
21
+ bundle exec bridgetown apply https://github.com/bridgetownrb/bridgetown-cloudinary
22
22
  ```
23
23
 
24
- Or simply add this line to your Gemfile and run `bundle install`:
24
+ Otheriwse, you can run this command to add this plugin to your site's Gemfile:
25
25
 
26
- ```ruby
27
- gem 'bridgetown-cloudinary', group: "bridgetown_plugins"
26
+ ```shell
27
+ $ bundle add bridgetown-cloudinary -g bridgetown_plugins
28
28
  ```
29
29
 
30
30
  Then modify your `bridgetown.config.yml` configuration to point to your Cloudinary
@@ -1,6 +1,6 @@
1
1
  # Supporting the upcoming automation feature
2
2
 
3
- say_status "Cloudinary", "Installing the bridgetown-cloudinary plugin..."
3
+ say_status :cloudinary, "Installing the bridgetown-cloudinary plugin..."
4
4
 
5
5
  cloud_name = ask("What's your Cloudinary cloud name?")
6
6
 
@@ -13,3 +13,6 @@ append_to_file "bridgetown.config.yml" do
13
13
  cloud_name: #{cloud_name}
14
14
  YAML
15
15
  end
16
+
17
+ say_status :cloudinary, "All set! Double-check the cloudinary block in your config file and review docs at"
18
+ say_status :cloudinary, "https://github.com/bridgetownrb/bridgetown-cloudinary"
@@ -32,6 +32,10 @@ module Bridgetown
32
32
  generator :add_image_urls_to_documents
33
33
  liquid_tag "cloudinary_img", :img_tag
34
34
  liquid_filter "cloudinary_url", :url_filter
35
+ if respond_to? :helper
36
+ helper "cloudinary_img", :img_helper
37
+ helper "cloudinary_url", :url_filter
38
+ end
35
39
  end
36
40
 
37
41
  # Populate front matter
@@ -51,7 +55,12 @@ module Bridgetown
51
55
  "<img alt=\"#{alt}\" src=\"#{url_filter(id, transformation)}\" />"
52
56
  end
53
57
 
54
- # Define the "cloudinary_url" Liquid filter
58
+ # Define the "cloudinary_img" Ruby helper
59
+ def img_helper(alt, id, transformation = nil)
60
+ "<img alt=\"#{alt}\" src=\"#{url_filter(id, transformation)}\" />"
61
+ end
62
+
63
+ # Define the "cloudinary_url" Liquid filter / Ruby helper
55
64
  def url_filter(id, transformation = nil)
56
65
  Bridgetown::Cloudinary::Utils.url(
57
66
  config: config[:cloudinary], id: id, transformation: transformation
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bridgetown
4
4
  module Cloudinary
5
- VERSION = "1.0.2"
5
+ VERSION = "1.1.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-cloudinary
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-21 00:00:00.000000000 Z
11
+ date: 2020-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown
@@ -121,6 +121,7 @@ extensions: []
121
121
  extra_rdoc_files: []
122
122
  files:
123
123
  - ".gitignore"
124
+ - ".prettierignore"
124
125
  - ".rspec"
125
126
  - ".rubocop.yml"
126
127
  - CHANGELOG.md