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 +4 -4
- data/README.md +1 -1
- data/lib/jekyll-link-decorator/version.rb +1 -1
- data/lib/jekyll-link-decorator.rb +13 -15
- metadata +15 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 86487049f93f8629a147eb1951acfd42988230e0be214177364a9c1b1125a369
|
|
4
|
+
data.tar.gz: ec957d708689c5005016bee2ac210ecbd12aefa85f0454873ef28e964492ee3a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6c419799160ddd533b6119a3182959b3961b101c2a0d3fd7aba9ab0be4c271451eda7cf637eab717f1dfbd4ca59ff0fbe20a1e13fac7c66a67ad88f57f1fab08
|
|
7
|
+
data.tar.gz: 36b2e3c4a30442c7bf603a3607fa6591b6e347b5471139a71a22626ebce4e7004060783d473848dba9c48e196778691457b06c6ae65f6c682b2e59c1d0409b39
|
data/README.md
CHANGED
|
@@ -43,20 +43,20 @@
|
|
|
43
43
|
#
|
|
44
44
|
# === Heading Anchor Support ===
|
|
45
45
|
#
|
|
46
|
-
# The plugin can inject a
|
|
47
|
-
#
|
|
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`:
|
|
55
|
-
#
|
|
56
|
-
#
|
|
57
|
-
#
|
|
58
|
-
#
|
|
59
|
-
#
|
|
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: "
|
|
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 = '
|
|
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
|
+
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
|