jekyll_img 0.1.3 → 0.1.5
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 +7 -0
- data/README.md +4 -9
- data/jekyll_img.gemspec +4 -4
- 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 +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 680dc86da728e4001fcbaf29a400b217690bd0242dd64a85a38e803286e0caa6
|
4
|
+
data.tar.gz: 53e917f32db474dd507794e8467cd5e1fc6e3036428133e1b27f48fea0be4e4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1792d517f0913bf3ef12a2c116e27f02d35ba56cf783d2bb230f0258c388a58861ad7e212783e4745f9a4ca261193e327d86fb965f2a576525ab54ae607c42b
|
7
|
+
data.tar.gz: 1c7f2ecc873f7b625bf18e42f50c191ccfeee09dcbc2a4a502b3f02ad8d81f1488730a51b9e9beb5580c13791e5bf1f784810aa4031d3c180db4d4075dd6940a
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## 0.1.5 / 2023-05-30
|
2
|
+
* Updated dependencies
|
3
|
+
|
4
|
+
## 0.1.4 / 2023-04-02
|
5
|
+
* Added [`attribution` support](https://github.com/mslinn/jekyll_plugin_support#subclass-attribution).
|
6
|
+
* Fixed `style=' false'` that appeared when the `style` and `wrapper_style` attributes were not provided.
|
7
|
+
|
1
8
|
## 0.1.3 / 2023-02-22
|
2
9
|
* Added `img/continue_on_error` configuration parameter.
|
3
10
|
|
data/README.md
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
[](https://badge.fury.io/rb/jekyll_img)
|
3
3
|
===========
|
4
4
|
|
5
|
-
`Jekyll_img` is a Jekyll plugin that
|
6
|
-
|
5
|
+
`Jekyll_img` is a Jekyll plugin that embeds images in HTML documents, with alignment options,
|
6
|
+
flexible resizing, default styling, overridable styling, an optional caption, and an optional URL.
|
7
7
|
|
8
8
|
See [demo/index.html](demo/index.html) for examples.
|
9
9
|
|
@@ -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
|
@@ -77,7 +78,7 @@ The wrapper allows for a simple, consistent approach regardless of whether a cap
|
|
77
78
|
The wrapper width is identical to the displayed image width.
|
78
79
|
Within the wrapper `<div />`, the embedded `<img />` is displayed with `width=100%`.
|
79
80
|
If a caption is required, the generated `<figure />` only makes the space taken by the generated HTML longer;
|
80
|
-
the image width and height
|
81
|
+
the image’s width and height are not affected.
|
81
82
|
|
82
83
|
The wrapper will not exceed the width of the tag that encloses it if the `size` parameter has values `eighthsize`, `fullsize`, `halfsize`, `initial` or `quartersize`.
|
83
84
|
|
@@ -98,12 +99,6 @@ group :jekyll_plugins do
|
|
98
99
|
end
|
99
100
|
```
|
100
101
|
|
101
|
-
Also add it to `_config.yml`:
|
102
|
-
```yaml
|
103
|
-
plugins:
|
104
|
-
- jekyll_img
|
105
|
-
```
|
106
|
-
|
107
102
|
And then execute:
|
108
103
|
|
109
104
|
$ bundle install
|
data/jekyll_img.gemspec
CHANGED
@@ -1,13 +1,13 @@
|
|
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'
|
7
7
|
spec.authors = ['Mike Slinn']
|
8
8
|
spec.email = ['mslinn@mslinn.com']
|
9
9
|
spec.files = Dir['.rubocop.yml', 'LICENSE.*', 'Rakefile', '{lib,spec}/**/*', '*.gemspec', '*.md']
|
10
|
-
spec.homepage = 'https://mslinn.com/
|
10
|
+
spec.homepage = 'https://www.mslinn.com/jekyll_plugins/jekyll_img.html'
|
11
11
|
spec.license = 'MIT'
|
12
12
|
spec.metadata = {
|
13
13
|
'allowed_push_host' => 'https://rubygems.org',
|
@@ -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', '
|
32
|
+
spec.add_dependency 'jekyll_plugin_support', '>= 0.7.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.5
|
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-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: jekyll_plugin_support
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.7.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.7.0
|
41
41
|
description:
|
42
42
|
email:
|
43
43
|
- mslinn@mslinn.com
|
@@ -59,14 +59,14 @@ files:
|
|
59
59
|
- spec/img_props_spec.rb
|
60
60
|
- spec/jekyll_img_spec.rb
|
61
61
|
- spec/spec_helper.rb
|
62
|
-
homepage: https://mslinn.com/
|
62
|
+
homepage: https://www.mslinn.com/jekyll_plugins/jekyll_img.html
|
63
63
|
licenses:
|
64
64
|
- MIT
|
65
65
|
metadata:
|
66
66
|
allowed_push_host: https://rubygems.org
|
67
67
|
bug_tracker_uri: https://github.com/mslinn/jekyll_img/issues
|
68
68
|
changelog_uri: https://github.com/mslinn/jekyll_img/CHANGELOG.md
|
69
|
-
homepage_uri: https://mslinn.com/
|
69
|
+
homepage_uri: https://www.mslinn.com/jekyll_plugins/jekyll_img.html
|
70
70
|
source_code_uri: https://github.com/mslinn/jekyll_img
|
71
71
|
post_install_message: |2+
|
72
72
|
|
@@ -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
|