jekyll-link-decorator 1.4.0 → 1.5.1

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: 7edfd6ee252b912cb6d3c30f50fcf6c0da0f0e5dc49694f3d2990ac6511e4584
4
- data.tar.gz: 8cf8478f0a431f2b436356d5cd905586629bc3eea130cd777516435f9260284c
3
+ metadata.gz: 86487049f93f8629a147eb1951acfd42988230e0be214177364a9c1b1125a369
4
+ data.tar.gz: ec957d708689c5005016bee2ac210ecbd12aefa85f0454873ef28e964492ee3a
5
5
  SHA512:
6
- metadata.gz: 8ece38e9ce327d4c4868ff3d1273cee59abcf0b02f6e7171b4bae061c175eaec359e6a359549f2c9f534a73356f8024a4cf1141ff9b8bb7a38e5a179b55b8994
7
- data.tar.gz: 3327e7a86426bc7c43931f579fa9924b30970e7a8f6ee38c2a5dbf7d2a3345e388f157e34a89fd069945d2a41513514db82bf02e7a9f8e6032ea85f44530525c
6
+ metadata.gz: 6c419799160ddd533b6119a3182959b3961b101c2a0d3fd7aba9ab0be4c271451eda7cf637eab717f1dfbd4ca59ff0fbe20a1e13fac7c66a67ad88f57f1fab08
7
+ data.tar.gz: 36b2e3c4a30442c7bf603a3607fa6591b6e347b5471139a71a22626ebce4e7004060783d473848dba9c48e196778691457b06c6ae65f6c682b2e59c1d0409b39
data/README.md CHANGED
@@ -13,4 +13,4 @@ For complete documentation, configuration options, and examples, visit the
13
13
 
14
14
  ## License
15
15
 
16
- MIT License - see LICENSE file for details.
16
+ MIT License - see [LICENSE](LICENSE) file for details.
@@ -6,6 +6,6 @@ module Jekyll
6
6
  # Regenerated alongside the gemspec on every `make gemspec` run (locally
7
7
  # or in CI), so it always matches spec.version in the built gem. Any
8
8
  # hand edit is overwritten on the next run.
9
- VERSION = '1.4.0'
9
+ VERSION = '1.5.1'
10
10
  end
11
11
  end
@@ -43,20 +43,20 @@
43
43
  #
44
44
  # === Heading Anchor Support ===
45
45
  #
46
- # The plugin can inject a Font Awesome link icon inside each heading (h1–h6),
47
- # giving users a direct, copyable URL to every section. This feature is configured
46
+ # The plugin can inject a permalink icon inside each heading (h1–h6), giving
47
+ # users a direct, linkable URL to every section. This feature is configured
48
48
  # via two top-level keys (separate from `with_link_decorator_data`):
49
49
  #
50
50
  # * `with_heading_anchor`: Boolean (default: false) that controls whether heading anchors
51
51
  # are injected. Set to true to enable.
52
52
  #
53
53
  # * `with_heading_anchor_data`: A dictionary containing optional configuration keys:
54
- # - `icon`: Font Awesome icon classes (default: "fa-solid fa-hashtag")
55
- # - `icon_size`: Font Awesome size modifier appended after icon classes (optional)
56
- # - `copy_success_message`: Feedback text after copying (consumed by heading-anchor.js,
57
- # default: "Copied!")
58
- # - `reset_delay`: Milliseconds before the icon resets (consumed by heading-anchor.js,
59
- # default: 2000)
54
+ # - `icon`: CSS classes applied to the anchor's glyph element (default:
55
+ # "heading-anchor-hash pe-1", which renders a plain "#" via the
56
+ # jekyll-theme-centos-base theme's CSS). Accepts any class list, including
57
+ # Font Awesome icon classes (e.g. "fa-solid fa-hashtag") for sites that
58
+ # want an icon-font glyph instead.
59
+ # - `icon_size`: Optional size modifier class appended after the icon classes.
60
60
  #
61
61
  # If no configuration is provided, the plugin will use default fallback classes
62
62
  # and enable external link icons.
@@ -75,9 +75,7 @@
75
75
  #
76
76
  # with_heading_anchor: true
77
77
  # with_heading_anchor_data:
78
- # icon: "fa-solid fa-hashtag"
79
- # copy_success_message: "Copied!"
80
- # reset_delay: 2000
78
+ # icon: "heading-anchor-hash pe-1"
81
79
  # ```
82
80
 
83
81
  require 'nokogiri'
@@ -105,7 +103,7 @@ module Jekyll
105
103
  DEFAULT_EXTERNAL_LINK_ICON = true
106
104
  DEFAULT_EXTERNAL_LINK_ICON_EXCLUDED_TAGS = [].freeze
107
105
  DEFAULT_HEADING_ANCHOR = false
108
- DEFAULT_HEADING_ANCHOR_ICON = 'fa-solid fa-hashtag'
106
+ DEFAULT_HEADING_ANCHOR_ICON = 'heading-anchor-hash pe-1'
109
107
 
110
108
  def self.name
111
109
  'LinkDecorator'
@@ -249,14 +247,14 @@ module Jekyll
249
247
  default_classes = config.fetch('default_link_classes', DEFAULT_LINK_CLASSES)
250
248
  alert_classes = config.fetch('alert_link_classes', DEFAULT_ALERT_LINK_CLASSES)
251
249
 
252
- # Apply alert classes to links inside p.alert
253
- doc.css('p.alert a:not(.btn)').each do |link|
250
+ # Apply alert classes to links inside p.alert or blockquote.alert
251
+ doc.css('p.alert a:not(.btn), blockquote.alert a:not(.btn)').each do |link|
254
252
  add_classes(link, alert_classes)
255
253
  end
256
254
 
257
255
  # Apply default classes to all other non-alert links
258
256
  doc.css('a:not(.btn)').each do |link|
259
- next if link.ancestors('p.alert').any?
257
+ next if link.ancestors('p.alert, blockquote.alert').any?
260
258
 
261
259
  classes_to_add = if link['class'].to_s.match?(/\blink-underline-(?!opacity)\S+/)
262
260
  default_classes.split.grep_v(/\Alink-underline-(?!opacity)/).join(' ')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-link-decorator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alain Reguera Delgado
@@ -105,6 +105,20 @@ dependencies:
105
105
  - - "~>"
106
106
  - !ruby/object:Gem::Version
107
107
  version: '3.13'
108
+ - !ruby/object:Gem::Dependency
109
+ name: rspec_junit_formatter
110
+ requirement: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - "~>"
113
+ - !ruby/object:Gem::Version
114
+ version: '0.6'
115
+ type: :development
116
+ prerelease: false
117
+ version_requirements: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - "~>"
120
+ - !ruby/object:Gem::Version
121
+ version: '0.6'
108
122
  - !ruby/object:Gem::Dependency
109
123
  name: simplecov
110
124
  requirement: !ruby/object:Gem::Requirement