jekyll_img 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d314eb97784260ac71168aa8dc6da63e0dec2238d75a9e57b4662ba103cf47c
4
- data.tar.gz: b353c583b4334d7c49c1961b6c383b34014449834f852e9f14e9eeccb31b78b4
3
+ metadata.gz: 680dc86da728e4001fcbaf29a400b217690bd0242dd64a85a38e803286e0caa6
4
+ data.tar.gz: 53e917f32db474dd507794e8467cd5e1fc6e3036428133e1b27f48fea0be4e4b
5
5
  SHA512:
6
- metadata.gz: 30ae18bc4ff268d928b503f55e7ba847a7ae767864a0dad41ffc80728afaab88aae8b8e17b4f5d2381ff75c0ecfb7a4a5f4cf3dd399fe05a8a1268f1d1a32505
7
- data.tar.gz: 91bfb7286db21ac8933a823cdaa2c6af2d31dc1734d9dd0b2222bf90a515a1b04d3119f21b438badd7fddf969ed9f1a2c93e2642763cd1af3a1a5b00b9807bea
6
+ metadata.gz: c1792d517f0913bf3ef12a2c116e27f02d35ba56cf783d2bb230f0258c388a58861ad7e212783e4745f9a4ca261193e327d86fb965f2a576525ab54ae607c42b
7
+ data.tar.gz: 1c7f2ecc873f7b625bf18e42f50c191ccfeee09dcbc2a4a502b3f02ad8d81f1488730a51b9e9beb5580c13791e5bf1f784810aa4031d3c180db4d4075dd6940a
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,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
  [![Gem Version](https://badge.fury.io/rb/jekyll_img.svg)](https://badge.fury.io/rb/jekyll_img)
3
3
  ===========
4
4
 
5
- `Jekyll_img` is a Jekyll plugin that displays images,
6
- and provides support for captions and URLs.
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 is not affected.
81
+ the image&rsquo;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| # 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'
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/jekyll/3000-jekyll-plugins.html#jekyll_img'
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 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.7.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.5'.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.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-02-26 00:00:00.000000000 Z
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.5.1
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.5.1
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/jekyll/3000-jekyll-plugins.html#jekyll_img
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/jekyll/3000-jekyll-plugins.html#jekyll_img
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 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