bridgetown-cloudinary 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.prettierignore +1 -0
- data/CHANGELOG.md +8 -0
- data/README.md +5 -5
- data/bridgetown.automation.rb +4 -1
- data/lib/bridgetown-cloudinary/builder.rb +10 -1
- data/lib/bridgetown-cloudinary/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 366f2d5d3354c186045ea89968b96df7bce677b391990e864ba355f1181e9386
|
4
|
+
data.tar.gz: 72de912532f48ede11a53676cb3b0f333a88cf7025f8d163a88501b91b827788
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 870607b637392b2d753fa705eba71808e6965acb032854c24b4d3beb47c606f88d1edaee07aa335c013ccc63b384835344a1707e527beb7f47a17fec0998bf80
|
7
|
+
data.tar.gz: 1f7515d6c563cf488d47f55ae18effdfb781c60fd62f568bb377cd22b84ff6723d8290162a6c36e95c1ff839813bf17cb3b635a5c7a46f02a9d0051c79f2c6e4
|
data/.prettierignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.md
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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
|
-
|
21
|
+
bundle exec bridgetown apply https://github.com/bridgetownrb/bridgetown-cloudinary
|
22
22
|
```
|
23
23
|
|
24
|
-
|
24
|
+
Otheriwse, you can run this command to add this plugin to your site's Gemfile:
|
25
25
|
|
26
|
-
```
|
27
|
-
|
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
|
data/bridgetown.automation.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Supporting the upcoming automation feature
|
2
2
|
|
3
|
-
say_status
|
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 "
|
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
|
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
|
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-
|
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
|