jekyll_href 1.2.2 → 1.2.3
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/CHANGELOG.md +3 -0
- data/README.md +10 -0
- data/lib/href_tag.rb +14 -2
- data/lib/jekyll_href/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f273b4ad20431d42f67bd6a8bba43823e158b4239d385951371e5511f31483f6
|
4
|
+
data.tar.gz: 13ce74af244bd5d9d26c44a7ebeb340126f729f084cddf04c75d0b79e83e973e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69169786943109c5f2fb288a430d247f8fa3a46b4d94c78607c012f3a9abd4116f38e66a4071e11c8bb53e8d21e7b3efe716aaf32d7a93c73d670026a24038bc
|
7
|
+
data.tar.gz: b37d5401822827f70f9b1e00f5eef1e93f8cab00c97a808409d71e6f173d99c0dc7bab5e33c07c2e41b98d47a2749a2e9e771588f167c8b269fa50b07c47cc96
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -85,6 +85,15 @@ If both are specified, `blank` prevails.
|
|
85
85
|
### `follow`
|
86
86
|
To suppress the `nofollow` attribute, preface the link with the word `follow`.
|
87
87
|
|
88
|
+
### `label='whatever you want'`
|
89
|
+
If the text to be linked contains an optional keyword argument,
|
90
|
+
for example `summary`, that word will be removed from the displayed link text,
|
91
|
+
unless the link text is provided via the `label` option.
|
92
|
+
Both of the following produce the same output:
|
93
|
+
```
|
94
|
+
{% href https://mslinn.com label="This is a summary" %}
|
95
|
+
{% href label="This is a summary" https://mslinn.com %}
|
96
|
+
```
|
88
97
|
|
89
98
|
### `notarget`
|
90
99
|
To suppress the `target` attribute, preface the link with the word `notarget`.
|
@@ -130,6 +139,7 @@ Expands to:
|
|
130
139
|
### `summary`
|
131
140
|
The `summary` name/value option provides an override for the linked text in the **References** section
|
132
141
|
generated by the `{% href_summary %}` tag.
|
142
|
+
If the value is the empty string, or no value is provided, the `href` tag is not included in the page summary.
|
133
143
|
|
134
144
|
|
135
145
|
### `summary_exclude`
|
data/lib/href_tag.rb
CHANGED
@@ -55,6 +55,17 @@ module HrefTag
|
|
55
55
|
return if @summary_exclude || @link_save.start_with?('mailto:') || @link_save.start_with?('#')
|
56
56
|
|
57
57
|
@summary = @summary.to_s.empty? ? @text : @summary.to_s
|
58
|
+
if @summary == true
|
59
|
+
warning = <<~END_WARNING
|
60
|
+
Warning: a href plugin keyword option was detected in the link text for #{@path} on line #{line_number}.
|
61
|
+
The href tag will not be included in the summary, and the link text will not have the word summary included.
|
62
|
+
This is probably unintentional. Consider using the label option to correct this problem."
|
63
|
+
END_WARNING
|
64
|
+
puts warning.red
|
65
|
+
return
|
66
|
+
end
|
67
|
+
return if @summary.class != String || @summary.empty?
|
68
|
+
|
58
69
|
@summary = @summary[0].upcase + @summary[1..]
|
59
70
|
@summary_href = "<a href='#{@link_save}'#{@target}#{@follow}>#{@summary}</a>"
|
60
71
|
mini_href = MiniHref.new(
|
@@ -109,9 +120,10 @@ module HrefTag
|
|
109
120
|
@path = @page['path']
|
110
121
|
AllCollectionsHooks.compute(@site)
|
111
122
|
|
123
|
+
@blank = @helper.parameter_specified? 'blank'
|
112
124
|
@follow = @helper.parameter_specified?('follow') ? '' : " rel='nofollow'"
|
113
125
|
@match = @helper.parameter_specified? 'match'
|
114
|
-
@
|
126
|
+
@label = @helper.parameter_specified? 'label'
|
115
127
|
@summary_exclude = @helper.parameter_specified? 'summary_exclude'
|
116
128
|
@shy = @helper.parameter_specified? 'shy'
|
117
129
|
@summary = @helper.parameter_specified? 'summary'
|
@@ -133,7 +145,7 @@ module HrefTag
|
|
133
145
|
end
|
134
146
|
return
|
135
147
|
else
|
136
|
-
@text = tokens.join(' ').strip
|
148
|
+
@text = @label || tokens.join(' ').strip
|
137
149
|
if @text.to_s.empty?
|
138
150
|
text = linkk
|
139
151
|
text = linkk.gsub('/', '/­') if @shy
|
data/lib/jekyll_href/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_href
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
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-
|
11
|
+
date: 2023-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|