jekyll_href 1.0.1 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/jekyll_href/version.rb +1 -1
- data/lib/jekyll_href.rb +7 -6
- 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: 2ac9c9737cba4b3509c84de7b06da21041b839db280cb8cbc77310252939974e
|
4
|
+
data.tar.gz: cad78f098ac87ff61d41761aabd36a2b048c3169270ff1d188eeb5deedd2ac7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68fbfaed3a11ff94d8fe24e3175cb71d4735e3f22e89ac044a1c8e3d205c59fa5d3e6bfb11e4c182caa889cb69ad3f840782bac0c810d07dc26f3891e7997e49
|
7
|
+
data.tar.gz: 888345783992115409644792d18c02a32a076ab8a6d150b59ee9c4cfd9e7a207fb442d6ddf1efc220568f148ce40a176c4818a6019fbf307ec80988c92bf2ba0
|
data/CHANGELOG.md
CHANGED
data/lib/jekyll_href/version.rb
CHANGED
data/lib/jekyll_href.rb
CHANGED
@@ -53,9 +53,9 @@ require_relative "jekyll_href/version"
|
|
53
53
|
class ExternalHref < Liquid::Tag
|
54
54
|
# @param tag_name [String] is the name of the tag, which we already know.
|
55
55
|
# @param command_line [Hash, String, Liquid::Tag::Parser] the arguments from the web page.
|
56
|
-
# @param
|
56
|
+
# @param _parse_context [Liquid::ParseContext] tokenized command line
|
57
57
|
# @return [void]
|
58
|
-
def initialize(tag_name, command_line,
|
58
|
+
def initialize(tag_name, command_line, _parse_context)
|
59
59
|
super
|
60
60
|
|
61
61
|
@match = false
|
@@ -64,15 +64,15 @@ class ExternalHref < Liquid::Tag
|
|
64
64
|
@target = get_value("notarget", " target='_blank'")
|
65
65
|
@logger = PluginMetaLogger.instance.new_logger(self)
|
66
66
|
|
67
|
-
match_index = tokens.index("match")
|
67
|
+
match_index = @tokens.index("match")
|
68
68
|
if match_index
|
69
|
-
tokens.delete_at(match_index)
|
69
|
+
@tokens.delete_at(match_index)
|
70
70
|
@follow = ""
|
71
71
|
@match = true
|
72
72
|
@target = ""
|
73
73
|
end
|
74
74
|
|
75
|
-
finalize tokens
|
75
|
+
finalize @tokens
|
76
76
|
end
|
77
77
|
|
78
78
|
# Method prescribed by the Jekyll plugin lifecycle.
|
@@ -103,7 +103,7 @@ class ExternalHref < Liquid::Tag
|
|
103
103
|
|
104
104
|
def get_value(token, default_value)
|
105
105
|
value = default_value
|
106
|
-
target_index = tokens.index(token)
|
106
|
+
target_index = @tokens.index(token)
|
107
107
|
if target_index
|
108
108
|
@tokens.delete_at(target_index)
|
109
109
|
value = ""
|
@@ -131,6 +131,7 @@ class ExternalHref < Liquid::Tag
|
|
131
131
|
@text = "<i>#{@link} is not available</i>"
|
132
132
|
end
|
133
133
|
when 1
|
134
|
+
@link = posts.first.url
|
134
135
|
@link = "#{@link}\##{fragment}" if fragment
|
135
136
|
else
|
136
137
|
abort "Error: More than one url matched: #{ matches.join(", ")}"
|
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.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Slinn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|