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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d314eb97784260ac71168aa8dc6da63e0dec2238d75a9e57b4662ba103cf47c
4
- data.tar.gz: b353c583b4334d7c49c1961b6c383b34014449834f852e9f14e9eeccb31b78b4
3
+ metadata.gz: 2f9a0ee86751118f5ed309e486751eede3ce4d5c3dad14ecbe7d695aefcc54ee
4
+ data.tar.gz: a42e9552fe07aadb4f24882280505f2b55fbeb5b4789e5cb27e7d2f8e9ec7e75
5
5
  SHA512:
6
- metadata.gz: 30ae18bc4ff268d928b503f55e7ba847a7ae767864a0dad41ffc80728afaab88aae8b8e17b4f5d2381ff75c0ecfb7a4a5f4cf3dd399fe05a8a1268f1d1a32505
7
- data.tar.gz: 91bfb7286db21ac8933a823cdaa2c6af2d31dc1734d9dd0b2222bf90a515a1b04d3119f21b438badd7fddf969ed9f1a2c93e2642763cd1af3a1a5b00b9807bea
6
+ metadata.gz: ad481773b5aabb69f9e8a24c1c3477fa112298f10c9fd21f1f28c008eedb694991107532787c625a0ad736bea7baac2f23220494ad6b2e4b5b56471074bb88fe
7
+ data.tar.gz: efef2dd2953194241346f6b354f2429241b0c9d116b5251d97a79d9654d9323acfbb101d1a33ac8481635a365c269224f0bce242aa2e1062661e917a2ba5f0b7
data/.rubocop.yml CHANGED
@@ -29,8 +29,7 @@ Layout/InitialIndentation:
29
29
 
30
30
  Layout/HashAlignment:
31
31
  EnforcedColonStyle: table
32
- Exclude:
33
- - jekyll_img.gemspec
32
+ EnforcedHashRocketStyle: table
34
33
 
35
34
  Layout/LineLength:
36
35
  Max: 150
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| # rubocop:disable Metrics/BlockLength
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 filter that creates formatted quotes.'
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.5.1'
32
+ spec.add_dependency 'jekyll_plugin_support', '~> 0.6.0'
33
33
  end
data/lib/img_builder.rb CHANGED
@@ -32,6 +32,7 @@ class ImgBuilder
32
32
  }
33
33
  #{generate_figure_caption}
34
34
  #{"</figure>\n" if @props.caption}
35
+ #{@props.attribute if @props.attribution}
35
36
  </div>
36
37
  END_HTML
37
38
  result.strip
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
@@ -1,3 +1,3 @@
1
1
  module JekyllImgVersion
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
data/lib/jekyll_img.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'jekyll_plugin_support'
2
- require 'jekyll_plugin_support_helper'
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'
@@ -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
- quote = described_class.send(
58
+ img = described_class.send(
59
59
  :new,
60
60
  'img',
61
61
  helper.markup.dup,
62
62
  parse_context
63
63
  )
64
- result = quote.send(:render_impl, helper.markup)
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.3
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-02-26 00:00:00.000000000 Z
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.5.1
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.5.1
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 filter that creates formatted quotes.
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