jekyll_href 1.2.4 → 1.2.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: 13925ae2b44abe077101e5302d6aee8a640cdf3c50dcb4a29c76e2c355dae039
4
- data.tar.gz: cf41c3a1c8424fc3e3ba67ccf6f27238e71766c72ed7006442291d855a933c4f
3
+ metadata.gz: 071f512c7ac10e09846593c0ba16664176d94f4b231e2fb8c20d447671ebdafd
4
+ data.tar.gz: 8b2bc1abb6ef1ce60a45e47623cf258215c0e17d74aac15ab13eaa5a003aff1d
5
5
  SHA512:
6
- metadata.gz: afa3c62bf2806362a3e52d6978a8ea9ad3b5eb21e5f685b5328c04c0e19728e680a58961bd0daac805fcfbef1f031e98c6de769b085c9c8e4f058a209793c325
7
- data.tar.gz: ce210b8cecefb1282991e9f4cca6ca5f80e7d94b9738f875f4848e9c445e24744e57c5a93f099e83362ed6e10448a38499f1907b96a04ef402db63710589f2aa
6
+ metadata.gz: 8f5ec5bdbaec6ea11245945dfa442725b99788e1229b2f2f38a2e6ed5881f8c67270b78d391fde9ec5a6df801ef2fdbbbf8cfba89bcab215eac7317ac9d5bef1
7
+ data.tar.gz: d0c075ec73231d74439cc4a804bd5fea1bb129ab4c018acb291c6aea531c633dd7f0c084c2ac361ba21b5fadbcaf7100a543fb019977f5d87927b36739c7bf95
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
+ ## 1.2.5 / 2023-05-26
2
+ * Added `style` and `class` options.
3
+
1
4
  ## 1.2.4 / 2023-05-18
2
- * When only a URI is provided, the plugin now generates the `http` scheme for IP4 & IP6 loopback addresses like
3
- `localhost`, and `127.0.0.0`, as well as private IP4 addresses like 192.168.0.0 and 172.16.0.0;
5
+ * When only a URI is provided, the plugin now generates the `http` scheme for IP4 & IP6 loopback addresses like
6
+ `localhost`, and `127.0.0.0`, as well as private IP4 addresses like 192.168.0.0 and 172.16.0.0;
4
7
  otherwise it generates the `https` scheme.
5
8
 
6
9
  ## 1.2.3 / 2023-05-16
data/README.md CHANGED
@@ -82,6 +82,20 @@ To enforce the generation of this attribute, preface the link with the word `bla
82
82
  The `blank` and `notarget` parameters are mutually exclusive.
83
83
  If both are specified, `blank` prevails.
84
84
 
85
+ ### `class`
86
+ This option allows CSS classes to be added to the HTML generated by the `href` tag.
87
+ It has no effect on the `href_summary` tag output.
88
+
89
+ For example:
90
+
91
+ ```
92
+ {% href class='bg_yellow' https://mslinn.com click here %}
93
+ ```
94
+ Expands to:
95
+ ```
96
+ <a href="https://mslinn.com" class="bg_yellow" rel="nofollow" target="_blank">click here</a>
97
+ ```
98
+
85
99
  ### `follow`
86
100
  To suppress the `nofollow` attribute, preface the link with the word `follow`.
87
101
 
@@ -109,8 +123,8 @@ The `match` option looks through the pages collection for a URL with containing
109
123
 
110
124
 
111
125
  ### `shy`
112
- `shy` is only applicable for syntax 3 (implicit URL).
113
- This option causes displayed urls to have an &amp;shy; inserted after each slash (/).
126
+ The `shy` keyword option is only applicable for syntax 3 (implicit URL).
127
+ This option causes displayed urls to have an [`&amp;shy;`](https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens) inserted after each slash (/).
114
128
  If both `shy` and `wbr` are specified, `wbr` prevails.
115
129
 
116
130
  For example:
@@ -119,21 +133,21 @@ For example:
119
133
  ```
120
134
  Expands to:
121
135
  ```
122
- <a href="https://mslinn.com/path/to/page.html">mslinn.com/&shy;path/&shy;to/&shy;page.html</a>
136
+ <a href="https://mslinn.com/path/to/page.html" rel="nofollow" target="_blank">mslinn.com/&shy;path/&shy;to/&shy;page.html</a>
123
137
  ```
124
138
 
125
- ### `shy`
126
- The `shy` keyword option is only applicable for syntax 3 (implicit URL).
127
- This option causes displayed urls to have an [`&amp;shy;`](https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens) inserted after each slash (/).
128
- If both `shy` and `wbr` are specified, `wbr` prevails.
139
+ ### `style`
140
+ This option allows CSS styling to be added to the HTML generated by the `href` tag.
141
+ It has no effect on the `href_summary` tag output.
129
142
 
130
143
  For example:
144
+
131
145
  ```
132
- {% href shy mslinn.com/path/to/page.html %}
146
+ {% href style='color: red; font-weight: bold;' https://mslinn.com click here %}
133
147
  ```
134
148
  Expands to:
135
149
  ```
136
- <a href="https://mslinn.com/path/to/page.html" rel="nofollow" target="_blank">mslinn.com/&shy;path/&shy;to/&shy;page.html</a>
150
+ <a href="https://mslinn.com" rel="nofollow" style="color: ref; font-weight: bold" target="_blank">click here</a>
137
151
  ```
138
152
 
139
153
  ### `summary`
data/jekyll_href.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  END_OF_DESC
11
11
  spec.email = ['mslinn@mslinn.com']
12
12
  spec.files = Dir['.rubocop.yml', 'LICENSE.*', 'Rakefile', '{lib,spec}/**/*', '*.gemspec', '*.md']
13
- spec.homepage = 'https://www.mslinn.com/jekyll/3000-jekyll-plugins.html#href'
13
+ spec.homepage = 'https://www.mslinn.com/jekyll_plugins/jekyll_href.html'
14
14
  spec.license = 'MIT'
15
15
  spec.metadata = {
16
16
  'allowed_push_host' => 'https://rubygems.org',
data/lib/href_tag.rb CHANGED
@@ -47,7 +47,9 @@ module HrefTag
47
47
  globals_update(@helper.argv, linkk) # Sets @link and @text, might clear @follow and @target
48
48
  handle_match if @match
49
49
  save_summary
50
- "<a href='#{@link}'#{@target}#{@follow}>#{@text}</a>"
50
+ klass = " class='#{@klass}'" if @klass
51
+ style = " style='#{@style}'" if @style
52
+ "<a href='#{@link}'#{klass}#{style}#{@target}#{@follow}>#{@text}</a>"
51
53
  end
52
54
 
53
55
  private
@@ -122,11 +124,13 @@ module HrefTag
122
124
  AllCollectionsHooks.compute(@site)
123
125
 
124
126
  @blank = @helper.parameter_specified? 'blank'
127
+ @klass = @helper.parameter_specified? 'class'
125
128
  @follow = @helper.parameter_specified?('follow') ? '' : " rel='nofollow'"
126
129
  @match = @helper.parameter_specified? 'match'
127
130
  @label = @helper.parameter_specified? 'label'
128
131
  @summary_exclude = @helper.parameter_specified? 'summary_exclude'
129
132
  @shy = @helper.parameter_specified? 'shy'
133
+ @style = @helper.parameter_specified? 'style'
130
134
  @summary = @helper.parameter_specified? 'summary'
131
135
  @target = @blank ? " target='_blank'" : nil
132
136
  @target ||= @helper.parameter_specified?('notarget') ? '' : " target='_blank'"
@@ -1,3 +1,3 @@
1
1
  module JekyllHrefVersion
2
- VERSION = '1.2.4'.freeze
2
+ VERSION = '1.2.5'.freeze
3
3
  end
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
4
+ version: 1.2.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-05-18 00:00:00.000000000 Z
11
+ date: 2023-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ipaddress
@@ -102,14 +102,14 @@ files:
102
102
  - spec/href_spec.rb
103
103
  - spec/spec_helper.rb
104
104
  - spec/status_persistence.txt
105
- homepage: https://www.mslinn.com/jekyll/3000-jekyll-plugins.html#href
105
+ homepage: https://www.mslinn.com/jekyll_plugins/jekyll_href.html
106
106
  licenses:
107
107
  - MIT
108
108
  metadata:
109
109
  allowed_push_host: https://rubygems.org
110
110
  bug_tracker_uri: https://github.com/mslinn/jekyll_href/issues
111
111
  changelog_uri: https://github.com/mslinn/jekyll_href/CHANGELOG.md
112
- homepage_uri: https://www.mslinn.com/jekyll/3000-jekyll-plugins.html#href
112
+ homepage_uri: https://www.mslinn.com/jekyll_plugins/jekyll_href.html
113
113
  source_code_uri: https://github.com/mslinn/jekyll_href
114
114
  post_install_message: |2+
115
115