jekyll_href 1.0.1 → 1.0.4

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: 04b0c09f10bc5a0bb0bf261e2a3ddab3aea102e5d3514b5aef5abd3678f796c2
4
- data.tar.gz: e30198e5c5a4a1a0faa1bc7fc56075a6689fd7686e953f297be17aca1f8c80fb
3
+ metadata.gz: 2ac9c9737cba4b3509c84de7b06da21041b839db280cb8cbc77310252939974e
4
+ data.tar.gz: cad78f098ac87ff61d41761aabd36a2b048c3169270ff1d188eeb5deedd2ac7c
5
5
  SHA512:
6
- metadata.gz: 6e5d0d5b784d7e4bcaa3869515598c61587e081880d6d1a0a642797a245dcc461f066999b11216ee48f727dabf4f57a765b5bb38841909c36dc5e7a41a099dbc
7
- data.tar.gz: 5f795dbcd6f8548799ceeabf2ede0edc2e2f2be6a9e958e148825d2672cff6c1fdd3cb32877413148c2e2b97f753948794a9da3bdfa804aaa09ad83ab70efa4c
6
+ metadata.gz: 68fbfaed3a11ff94d8fe24e3175cb71d4735e3f22e89ac044a1c8e3d205c59fa5d3e6bfb11e4c182caa889cb69ad3f840782bac0c810d07dc26f3891e7997e49
7
+ data.tar.gz: 888345783992115409644792d18c02a32a076ab8a6d150b59ee9c4cfd9e7a207fb442d6ddf1efc220568f148ce40a176c4818a6019fbf307ec80988c92bf2ba0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 1.0.4 / 2022-03-28
2
+ * Fixed problem with `match` option
3
+
1
4
  ## 1.0.0 / 2022-03-11
2
5
  * Made into a Ruby gem and published on RubyGems.org as [jekyll_href](https://rubygems.org/gems/jekyll_href).
3
6
  * `bin/attach` script added for debugging
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllHref
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.4"
5
5
  end
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 tokens [Liquid::ParseContext] tokenized command line
56
+ # @param _parse_context [Liquid::ParseContext] tokenized command line
57
57
  # @return [void]
58
- def initialize(tag_name, command_line, tokens)
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.1
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-25 00:00:00.000000000 Z
11
+ date: 2022-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll