jekyll_img 0.1.3 → 0.1.4
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 +4 -4
- data/.rubocop.yml +1 -2
- data/CHANGELOG.md +4 -0
- data/README.md +1 -0
- data/jekyll_img.gemspec +3 -3
- data/lib/img_builder.rb +1 -0
- data/lib/img_props.rb +2 -2
- data/lib/jekyll_img/version.rb +1 -1
- data/lib/jekyll_img.rb +5 -1
- data/spec/jekyll_img_spec.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f9a0ee86751118f5ed309e486751eede3ce4d5c3dad14ecbe7d695aefcc54ee
|
4
|
+
data.tar.gz: a42e9552fe07aadb4f24882280505f2b55fbeb5b4789e5cb27e7d2f8e9ec7e75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad481773b5aabb69f9e8a24c1c3477fa112298f10c9fd21f1f28c008eedb694991107532787c625a0ad736bea7baac2f23220494ad6b2e4b5b56471074bb88fe
|
7
|
+
data.tar.gz: efef2dd2953194241346f6b354f2429241b0c9d116b5251d97a79d9654d9323acfbb101d1a33ac8481635a365c269224f0bce242aa2e1062661e917a2ba5f0b7
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.1.4 / 2023-04-02
|
2
|
+
* Added [`attribution` support](https://github.com/mslinn/jekyll_plugin_support#subclass-attribution).
|
3
|
+
* Fixed `style=' false'` that appeared when the `style` and `wrapper_style` attributes were not provided.
|
4
|
+
|
1
5
|
## 0.1.3 / 2023-02-22
|
2
6
|
* Added `img/continue_on_error` configuration parameter.
|
3
7
|
|
data/README.md
CHANGED
@@ -19,6 +19,7 @@ $ demo/_bin/debug -r
|
|
19
19
|
|
20
20
|
`Options` are:
|
21
21
|
|
22
|
+
- `attribution` See [`jekyll_plugin_support`](https://github.com/mslinn/jekyll_plugin_support#subclass-attribution).
|
22
23
|
- `align="left|inline|right|center"` Default value is `inline`
|
23
24
|
- `alt="Alt text"` Default value is the `caption` text, if provided
|
24
25
|
- `caption="A caption"` No default value
|
data/jekyll_img.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative 'lib/jekyll_img/version'
|
2
2
|
|
3
|
-
Gem::Specification.new do |spec|
|
3
|
+
Gem::Specification.new do |spec|
|
4
4
|
github = 'https://github.com/mslinn/jekyll_img'
|
5
5
|
|
6
6
|
spec.bindir = 'exe'
|
@@ -24,10 +24,10 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
24
24
|
END_MESSAGE
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
spec.required_ruby_version = '>= 2.6.0'
|
27
|
-
spec.summary = 'Provides a Jekyll
|
27
|
+
spec.summary = 'Provides a Jekyll tag that generates images.'
|
28
28
|
spec.test_files = spec.files.grep %r{^(test|spec|features)/}
|
29
29
|
spec.version = JekyllImgVersion::VERSION
|
30
30
|
|
31
31
|
spec.add_dependency 'jekyll', '>= 3.5.0'
|
32
|
-
spec.add_dependency 'jekyll_plugin_support', '~> 0.
|
32
|
+
spec.add_dependency 'jekyll_plugin_support', '~> 0.6.0'
|
33
33
|
end
|
data/lib/img_builder.rb
CHANGED
data/lib/img_props.rb
CHANGED
@@ -5,8 +5,8 @@ class ImgError < StandardError; end
|
|
5
5
|
# attr_ methods can be called after compute_dependant_properties
|
6
6
|
# All methods except compute_dependant_properties can be called in any order
|
7
7
|
class ImgProperties
|
8
|
-
attr_accessor :align, :alt, :attr_wrapper_align_class, :caption, :classes, :continue_on_error,
|
9
|
-
:id, :img_display, :nofollow, :src, :size, :style, :target, :title,
|
8
|
+
attr_accessor :align, :alt, :attr_wrapper_align_class, :attribute, :attribution, :caption, :classes, :continue_on_error,
|
9
|
+
:id, :img_display, :nofollow, :src, :size, :style, :target, :title,
|
10
10
|
:url, :wrapper_class, :wrapper_style
|
11
11
|
|
12
12
|
SIZES = %w[eighthsize fullsize halfsize initial quartersize].freeze
|
data/lib/jekyll_img/version.rb
CHANGED
data/lib/jekyll_img.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'jekyll_plugin_support'
|
2
|
-
require '
|
2
|
+
require 'jekyll_plugin_helper'
|
3
3
|
require_relative 'img_builder'
|
4
4
|
require_relative 'img_props'
|
5
5
|
require_relative 'jekyll_img/version'
|
@@ -17,10 +17,14 @@ module Jekyll
|
|
17
17
|
include JekyllImgVersion
|
18
18
|
|
19
19
|
def render_impl # rubocop:disable Metrics/AbcSize
|
20
|
+
@helper.gem_file __FILE__ # This enables plugin attribution
|
21
|
+
|
20
22
|
config = @config['img']
|
21
23
|
@continue_on_error = config['continue_on_error'] == true if config
|
22
24
|
|
23
25
|
props = ImgProperties.new
|
26
|
+
props.attribute = @helper.attribute
|
27
|
+
props.attribution = @helper.attribution
|
24
28
|
props.align = @helper.parameter_specified?('align') || 'inline'
|
25
29
|
props.alt = @helper.parameter_specified? 'alt'
|
26
30
|
props.caption = @helper.parameter_specified? 'caption'
|
data/spec/jekyll_img_spec.rb
CHANGED
@@ -55,13 +55,13 @@ class MyTest
|
|
55
55
|
|
56
56
|
it 'has no cite or url' do
|
57
57
|
helper.reinitialize('src="./blah.webp"')
|
58
|
-
|
58
|
+
img = described_class.send(
|
59
59
|
:new,
|
60
60
|
'img',
|
61
61
|
helper.markup.dup,
|
62
62
|
parse_context
|
63
63
|
)
|
64
|
-
result =
|
64
|
+
result = img.send(:render_impl, helper.markup)
|
65
65
|
expect(result).to match_ignoring_whitespace <<-END_RESULT
|
66
66
|
<img src="./blah.webp">
|
67
67
|
END_RESULT
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_img
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Slinn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.6.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.6.0
|
41
41
|
description:
|
42
42
|
email:
|
43
43
|
- mslinn@mslinn.com
|
@@ -89,7 +89,7 @@ requirements: []
|
|
89
89
|
rubygems_version: 3.3.3
|
90
90
|
signing_key:
|
91
91
|
specification_version: 4
|
92
|
-
summary: Provides a Jekyll
|
92
|
+
summary: Provides a Jekyll tag that generates images.
|
93
93
|
test_files:
|
94
94
|
- spec/img_builder_spec.rb
|
95
95
|
- spec/img_props_spec.rb
|