jekyll-highlight-cards 0.3.1 → 1.0.0

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: c7cd9e66e3ef41ee1ac316caaac55c23904731e57913a8de95701fafc4a1aab7
4
- data.tar.gz: 4dc6209363472413dbcde00f2d997e577997ec0eff43bec5c230aad2e3667409
3
+ metadata.gz: 27cf68c0933a20201dc0314386e81566118ef263473ab335ff3fe5f278df6832
4
+ data.tar.gz: 5d66c46ea2cb0064c9fa414b04219ac613a5c0d5ef9fe61fb4f2777efa4abecd
5
5
  SHA512:
6
- metadata.gz: e33330d053557b592175187c7da9f2c1b8ce3ea8e29b3b1798b21fd07b5b4c074965a9e461ebd9a61ce600ab3917f509504021ac026ecbb84a2a8f3fdbc768e6
7
- data.tar.gz: 5942858336904a92024164afd15d20ab1a0c0f6cb11301ad138e0af2b18fcedbd6fee608e1361d5531cb01bad93146cb1c5c1aff319d34b4c98f4c558430110f
6
+ metadata.gz: 2d223398db2a0d03a771c06ec6eab6281ec65cb8f2bb7d87e8db007faa90c7c97ecbc1cac176750dec3eab898704b2668b9ca049a5122df8c424c8fede98b404
7
+ data.tar.gz: 2d14df56df6e3bfa9020a40ead922a01946a22a1e3debb837b4a8eea3bcf5eb0e01fe63219cbfd0f43cd305e0bd92e16c76bf573a823bac755b487437be428cd
@@ -0,0 +1,46 @@
1
+ version: 2
2
+ updates:
3
+ # bundler's rubygem dependencies
4
+ - package-ecosystem: 'bundler'
5
+ directory: '/'
6
+ schedule:
7
+ interval: 'weekly'
8
+ day: 'monday'
9
+ time: '09:00'
10
+ groups:
11
+ deps-minor-patch:
12
+ dependency-type: 'production'
13
+ update-types:
14
+ - 'minor'
15
+ - 'patch'
16
+ dev-deps-minor-patch:
17
+ dependency-type: 'development'
18
+ update-types:
19
+ - 'minor'
20
+ - 'patch'
21
+ open-pull-requests-limit: 10
22
+ assignees:
23
+ - 'Texarkanine'
24
+ commit-message:
25
+ prefix: 'fix'
26
+ include: 'scope'
27
+
28
+ # GitHub Actions dependencies
29
+ - package-ecosystem: 'github-actions'
30
+ directory: '/'
31
+ schedule:
32
+ interval: 'weekly'
33
+ day: 'monday'
34
+ time: '09:00'
35
+ groups:
36
+ github-actions-minor-patch:
37
+ patterns:
38
+ - '*'
39
+ update-types:
40
+ - 'minor'
41
+ - 'patch'
42
+ open-pull-requests-limit: 5
43
+ assignees:
44
+ - 'Texarkanine'
45
+ commit-message:
46
+ prefix: 'chore(deps-ci)'
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.3.1"
2
+ ".": "1.0.0"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.0](https://github.com/Texarkanine/jekyll-highlight-cards/compare/v0.3.1...v1.0.0) (2025-12-09)
4
+
5
+
6
+ ### Features
7
+
8
+ * **linkcard:** strip trailing slash from display urls ([7b2e3fb](https://github.com/Texarkanine/jekyll-highlight-cards/commit/7b2e3fb0645d6e927da55746711fed0d24147d8a))
9
+ * **polaroid:** add image_link parameter to override image href ([#11](https://github.com/Texarkanine/jekyll-highlight-cards/issues/11)) ([7b2e3fb](https://github.com/Texarkanine/jekyll-highlight-cards/commit/7b2e3fb0645d6e927da55746711fed0d24147d8a))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **deps-dev:** update rubocop-rspec requirement from ~> 2.20 to ~> 3.8 ([#13](https://github.com/Texarkanine/jekyll-highlight-cards/issues/13)) ([08e4a40](https://github.com/Texarkanine/jekyll-highlight-cards/commit/08e4a40c3463d43fc5eab9a4f4f04d335f34182c))
15
+ * **docs:** mention image_link in README ([50450a4](https://github.com/Texarkanine/jekyll-highlight-cards/commit/50450a4b20b4e5fd6ce6f0498bf208016903eb5d))
16
+ * **linkcard:** padding-bottom -> 1.5 so archive doesn't overlap with link url ([7b2e3fb](https://github.com/Texarkanine/jekyll-highlight-cards/commit/7b2e3fb0645d6e927da55746711fed0d24147d8a))
17
+
3
18
  ## [0.3.1](https://github.com/Texarkanine/jekyll-highlight-cards/compare/v0.3.0...v0.3.1) (2025-12-08)
4
19
 
5
20
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jekyll-highlight-cards (0.3.1)
4
+ jekyll-highlight-cards (1.0.0)
5
5
  jekyll (>= 4.0, < 5.0)
6
6
  liquid (>= 4.0, < 5.0)
7
7
 
@@ -133,22 +133,12 @@ GEM
133
133
  rubocop-ast (1.48.0)
134
134
  parser (>= 3.3.7.2)
135
135
  prism (~> 1.4)
136
- rubocop-capybara (2.22.1)
137
- lint_roller (~> 1.1)
138
- rubocop (~> 1.72, >= 1.72.1)
139
- rubocop-factory_bot (2.28.0)
140
- lint_roller (~> 1.1)
141
- rubocop (~> 1.72, >= 1.72.1)
142
136
  rubocop-rake (0.7.1)
143
137
  lint_roller (~> 1.1)
144
138
  rubocop (>= 1.72.1)
145
- rubocop-rspec (2.31.0)
146
- rubocop (~> 1.40)
147
- rubocop-capybara (~> 2.17)
148
- rubocop-factory_bot (~> 2.22)
149
- rubocop-rspec_rails (~> 2.28)
150
- rubocop-rspec_rails (2.29.1)
151
- rubocop (~> 1.61)
139
+ rubocop-rspec (3.8.0)
140
+ lint_roller (~> 1.1)
141
+ rubocop (~> 1.81)
152
142
  ruby-progressbar (1.13.0)
153
143
  safe_yaml (1.0.5)
154
144
  sass-embedded (1.95.0)
@@ -162,6 +152,9 @@ GEM
162
152
  docile (~> 1.1)
163
153
  simplecov-html (~> 0.11)
164
154
  simplecov_json_formatter (~> 0.1)
155
+ simplecov-cobertura (3.1.0)
156
+ rexml
157
+ simplecov (~> 0.19)
165
158
  simplecov-html (0.13.2)
166
159
  simplecov_json_formatter (0.1.4)
167
160
  terminal-table (3.0.2)
@@ -188,8 +181,9 @@ DEPENDENCIES
188
181
  rspec (~> 3.12)
189
182
  rubocop (~> 1.50)
190
183
  rubocop-rake (~> 0.6)
191
- rubocop-rspec (~> 2.20)
184
+ rubocop-rspec (~> 3.8)
192
185
  simplecov (~> 0.22)
186
+ simplecov-cobertura (~> 3.1)
193
187
  webmock (~> 3.18)
194
188
 
195
189
  BUNDLED WITH
data/README.md CHANGED
@@ -73,6 +73,7 @@ Create polaroid-style image cards:
73
73
  {% polaroid /assets/image.jpg alt="Screen reader description" %}
74
74
  {% polaroid /assets/image.jpg alt="Alt text" title="Visible Title" %}
75
75
  {% polaroid /assets/image.jpg title="Photo" link="https://example.com" %}
76
+ {% polaroid /assets/image.jpg link="https://example.com" image_link="https://other.com" %}
76
77
  {% polaroid {{ page.image }} size=x400 title={{ page.title }} %}
77
78
  ```
78
79
 
@@ -83,7 +84,8 @@ Create polaroid-style image cards:
83
84
  | `size=WxH` | Image dimensions. Formats: `300x200`, `300x`, `x200`, `300`, `400pxx300px` |
84
85
  | `alt="..."` | Alt text for image (for accessibility) |
85
86
  | `title="..."` | Title text displayed below image (also used as alt fallback) |
86
- | `link="..."` | Explicit URL to link to |
87
+ | `link="..."` | Explicit URL to link to (shows as visible link text) |
88
+ | `image_link="..."` | Override where the image links to (independent of visible link text) |
87
89
  | `archive="..."` | Archive URL or `none` to disable |
88
90
 
89
91
  **Image Alt Text:**
@@ -94,9 +96,11 @@ This allows you to:
94
96
  - Use title as both visual label and screen reader description
95
97
  - Separate concerns: detailed alt for accessibility, brief title for display
96
98
 
97
- **Link Display:**
99
+ **Link Behavior:**
98
100
  - **No `link` parameter:** Image links to itself, no visible link text shown
99
101
  - **With `link` parameter:** Image and visible link text both point to the specified URL
102
+ - **With `image_link` parameter:** Image links to `image_link` URL, overriding default behavior
103
+ - **With both `link` and `image_link`:** Image links to `image_link`, but visible text displays `link`
100
104
 
101
105
  **Stacking:**
102
106
 
@@ -173,7 +177,7 @@ Templates receive these variables:
173
177
  - `escaped_url`, `escaped_display_url`, `escaped_title`, `escaped_archive_url`
174
178
 
175
179
  **Polaroid variables:**
176
- - `image_url`, `link_url`, `title`, `link_display`, `archive_url`, `width`, `height`
180
+ - `image_url`, `link_url`, `image_link_url`, `title`, `link_display`, `archive_url`, `width`, `height`, `alt`
177
181
  - `escaped_*` versions of all text fields
178
182
 
179
183
  See default templates in gem's `_includes/` directory for examples.
@@ -1,6 +1,6 @@
1
1
  <div class="polaroid-container">
2
2
  <div class="polaroid">
3
- <a href="{{ escaped_link_url }}"{% unless link_url == image_url %} target="_blank" rel="noopener"{% endunless %}>
3
+ <a href="{{ escaped_image_link_url }}"{% unless image_link_url == image_url %} target="_blank" rel="noopener"{% endunless %}>
4
4
  <img src="{{ escaped_image_url }}" alt="{% if alt %}{{ escaped_alt }}{% elsif title %}{{ escaped_title }}{% endif %}"{% if width %} width="{{ width }}"{% endif %}{% if height %} height="{{ height }}"{% endif %} class="polaroid-image">
5
5
  </a>
6
6
  <div class="polaroid-title">{{ escaped_title }}</div>
@@ -18,7 +18,7 @@
18
18
  ========================================================================= */
19
19
 
20
20
  .link-card {
21
- padding: 1em 1.25em;
21
+ padding: 1em 1.25em 1.5em 1.25em;
22
22
  text-align: center;
23
23
  position: relative;
24
24
  }
@@ -41,7 +41,8 @@ Gem::Specification.new do |spec|
41
41
  spec.add_development_dependency "rspec", "~> 3.12"
42
42
  spec.add_development_dependency "rubocop", "~> 1.50"
43
43
  spec.add_development_dependency "rubocop-rake", "~> 0.6"
44
- spec.add_development_dependency "rubocop-rspec", "~> 2.20"
44
+ spec.add_development_dependency "rubocop-rspec", "~> 3.8"
45
45
  spec.add_development_dependency "simplecov", "~> 0.22"
46
+ spec.add_development_dependency "simplecov-cobertura", "~> 3.1"
46
47
  spec.add_development_dependency "webmock", "~> 3.18"
47
48
  end
@@ -184,6 +184,7 @@ module JekyllHighlightCards
184
184
  # @return [Hash] template variables with raw and escaped versions
185
185
  def build_template_variables(url, title, archive_url)
186
186
  display_url = strip_protocol(url)
187
+ display_url = display_url.sub(%r{/$}, "")
187
188
 
188
189
  {
189
190
  "url" => url,
@@ -4,7 +4,7 @@ module JekyllHighlightCards
4
4
  # Liquid tag for creating styled polaroid photo components
5
5
  #
6
6
  # Syntax:
7
- # {% polaroid IMAGE_URL [size=WxH] [alt="..."] [title="..."] [link="..."] [archive="..."] %}
7
+ # {% polaroid IMAGE_URL [size=WxH] [alt="..."] [title="..."] [link="..."] [image_link="..."] [archive="..."] %}
8
8
  #
9
9
  # Parameters:
10
10
  # - IMAGE_URL (required): Path or URL to the image (can be Liquid expression)
@@ -12,11 +12,17 @@ module JekyllHighlightCards
12
12
  # - alt="..." (optional): Alt text for the image (can be Liquid expression)
13
13
  # - title="..." (optional): Title text to display (can be Liquid expression, also used as alt fallback)
14
14
  # - link="..." (optional): URL to link to (can be Liquid expression)
15
+ # - image_link="..." (optional): URL for the image to link to, overrides default behavior (can be Liquid expression)
15
16
  # - archive="..." (optional): Archive URL or "none" to opt out
16
17
  #
17
18
  # Note: Alt text priority: alt parameter > title parameter > empty string
18
19
  # This allows setting alt text without a visible title for accessibility
19
20
  #
21
+ # Note: Image link behavior:
22
+ # - No link or image_link: image links to itself
23
+ # - link only: image links to link URL
24
+ # - image_link: image links to image_link URL (overrides default)
25
+ #
20
26
  # Examples:
21
27
  # {% polaroid /assets/img/photo.jpg %}
22
28
  # {% polaroid /img/photo.jpg size=300x200 title="My Photo" %}
@@ -24,6 +30,7 @@ module JekyllHighlightCards
24
30
  # {% polaroid /img/photo.jpg alt="Detailed alt" title="Short Title" %}
25
31
  # {% polaroid {{ page.image }} size=x400 title={{ page.title }} %}
26
32
  # {% polaroid /img.jpg link="https://example.com" archive="none" %}
33
+ # {% polaroid /img.jpg link="https://example.com" image_link="https://other.com" %}
27
34
  class PolaroidTag < Liquid::Tag
28
35
  include ArchiveHelper
29
36
  include DimensionParser
@@ -59,6 +66,14 @@ module JekyllHighlightCards
59
66
  explicit_link = !params[:link].nil? && !params[:link].empty?
60
67
  link_url = params[:link] || params[:image_url]
61
68
 
69
+ # Determine image link URL (can be overridden by image_link parameter)
70
+ # If image_link is provided, use it; otherwise use the standard link_url
71
+ image_link_url = if params[:image_link] && !params[:image_link].empty?
72
+ params[:image_link]
73
+ else
74
+ link_url
75
+ end
76
+
62
77
  # Resolve archive URL (archives the link URL, not the image)
63
78
  archive_url = resolve_archive(params[:archive], context, link_url)
64
79
 
@@ -70,6 +85,7 @@ module JekyllHighlightCards
70
85
  params[:title],
71
86
  params[:alt],
72
87
  link_url,
88
+ image_link_url,
73
89
  explicit_link,
74
90
  archive_url
75
91
  )
@@ -183,17 +199,29 @@ module JekyllHighlightCards
183
199
  # @param height [String, nil] the image height
184
200
  # @param title [String, nil] the title text
185
201
  # @param alt [String, nil] the alt text for the image
186
- # @param link_url [String] the link URL
202
+ # @param link_url [String] the link URL (for display)
203
+ # @param image_link_url [String] the URL the image links to
187
204
  # @param explicit_link [Boolean] whether link was explicitly provided
188
205
  # @param archive_url [String, nil] the archive URL
189
206
  # @return [Hash] template variables with raw and escaped versions
190
- def build_template_variables(image_url, width, height, title, alt, link_url, explicit_link, archive_url)
207
+ def build_template_variables(
208
+ image_url,
209
+ width,
210
+ height,
211
+ title,
212
+ alt,
213
+ link_url,
214
+ image_link_url,
215
+ explicit_link,
216
+ archive_url
217
+ )
191
218
  # Only set link_display if link was explicitly provided (not defaulted to image)
192
219
  link_display = explicit_link && link_url ? strip_protocol(link_url) : nil
193
220
 
194
221
  {
195
222
  "image_url" => image_url,
196
223
  "link_url" => link_url,
224
+ "image_link_url" => image_link_url,
197
225
  "title" => title,
198
226
  "alt" => alt,
199
227
  "link_display" => link_display,
@@ -202,6 +230,7 @@ module JekyllHighlightCards
202
230
  "height" => height,
203
231
  "escaped_image_url" => CGI.escapeHTML(image_url),
204
232
  "escaped_link_url" => link_url ? CGI.escapeHTML(link_url) : nil,
233
+ "escaped_image_link_url" => image_link_url ? CGI.escapeHTML(image_link_url) : nil,
205
234
  "escaped_title" => title && !title.empty? ? CGI.escapeHTML(title) : "&nbsp;",
206
235
  "escaped_alt" => alt && !alt.empty? ? CGI.escapeHTML(alt) : "",
207
236
  "escaped_link_display" => link_display && !link_display.empty? ? CGI.escapeHTML(link_display) : "&nbsp;",
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllHighlightCards
4
- VERSION = "0.3.1"
4
+ VERSION = "1.0.0"
5
5
  end
@@ -37,21 +37,17 @@ require_relative "jekyll-highlight-cards/image_sizing_hooks"
37
37
  #
38
38
  # @see README.md Full usage documentation
39
39
  module JekyllHighlightCards
40
-
41
40
  # 1. Define the path to SCSS files relative to this Ruby file
42
41
  SASS_PATH = File.join(File.dirname(__FILE__), "../_sass")
43
42
 
44
43
  # 2. Register a hook to run after Jekyll initializes
45
44
  Jekyll::Hooks.register :site, :after_init do |site|
46
-
47
45
  # Ensure the 'sass' and 'load_paths' config keys exist
48
46
  site.config["sass"] ||= {}
49
47
  site.config["sass"]["load_paths"] ||= []
50
48
 
51
49
  # 3. Append your plugin's path to the load_paths array
52
50
  # We check first to avoid adding it multiple times (e.g. in watch mode)
53
- unless site.config["sass"]["load_paths"].include?(SASS_PATH)
54
- site.config["sass"]["load_paths"] << SASS_PATH
55
- end
51
+ site.config["sass"]["load_paths"] << SASS_PATH unless site.config["sass"]["load_paths"].include?(SASS_PATH)
56
52
  end
57
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-highlight-cards
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Texarkanine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-08 00:00:00.000000000 Z
11
+ date: 2025-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -126,14 +126,14 @@ dependencies:
126
126
  requirements:
127
127
  - - "~>"
128
128
  - !ruby/object:Gem::Version
129
- version: '2.20'
129
+ version: '3.8'
130
130
  type: :development
131
131
  prerelease: false
132
132
  version_requirements: !ruby/object:Gem::Requirement
133
133
  requirements:
134
134
  - - "~>"
135
135
  - !ruby/object:Gem::Version
136
- version: '2.20'
136
+ version: '3.8'
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: simplecov
139
139
  requirement: !ruby/object:Gem::Requirement
@@ -148,6 +148,20 @@ dependencies:
148
148
  - - "~>"
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0.22'
151
+ - !ruby/object:Gem::Dependency
152
+ name: simplecov-cobertura
153
+ requirement: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - "~>"
156
+ - !ruby/object:Gem::Version
157
+ version: '3.1'
158
+ type: :development
159
+ prerelease: false
160
+ version_requirements: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - "~>"
163
+ - !ruby/object:Gem::Version
164
+ version: '3.1'
151
165
  - !ruby/object:Gem::Dependency
152
166
  name: webmock
153
167
  requirement: !ruby/object:Gem::Requirement
@@ -172,6 +186,7 @@ extensions: []
172
186
  extra_rdoc_files: []
173
187
  files:
174
188
  - ".cursorignore"
189
+ - ".github/dependabot.yaml"
175
190
  - ".github/workflows/ci.yaml"
176
191
  - ".github/workflows/release-please.yaml"
177
192
  - ".github/workflows/update-gemfile-lock.yaml"