jekyll-wikilinks 0.0.4 → 0.0.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: 9f7349631b7b0ce9484512d06a368ac2808d3d3c64bdf7ccd66e845dc5f41380
4
- data.tar.gz: 87c6d80c73e79c260d3b58acb8cc2e3c62dc0c29c2574a9c54bd5f476e70e8cf
3
+ metadata.gz: 0f6d8e47bdeb17eba9c47c70c35ed2622fe27ab4b6280fa1838d6c69f24723b9
4
+ data.tar.gz: bfb12748858bd1c810b5613e1c2f516e64d65772082a680e24b3c796f37b6e80
5
5
  SHA512:
6
- metadata.gz: 05a261827c04023b8072f85a566c88abad259885e6af6fd85909d61f93200849994de360076023b383f2abab7f3ad4d92e4e755f0ea9cd487e1c59692786d3bf
7
- data.tar.gz: 3b3862a5e00356d5227e39a346405e238255fe4cc4275c1f095a2ca828e62d7e1f3468035c99278c95dcbe2a340521588dd2ebc64571a9bec963affc19e9328e
6
+ metadata.gz: 0e6483f4844cc0b0d8fd43be71040bce438b5357972e2139660ca1979a2b42843af2355577a46dc0f119902e281fb244b4fc53d8db7f8a3760889073be08db36
7
+ data.tar.gz: 0af4216fa1fae8dbc086e785663d5ab4884afe83924c3b8fe5ef0ccb98fffa508dfc767b9c057b1dfec17efba36e3202eb494751ac53731209130c2108e43454
@@ -150,7 +150,7 @@ module JekyllWikiLinks
150
150
  label: doc.data['title'],
151
151
  }
152
152
  # TODO: this link calculation ends up with duplicates -- re-visit this later.
153
- all_links = doc.data['attributes'] + doc.data['backlinks']
153
+ all_links = doc.data['attributed'] + doc.data['backlinks']
154
154
  all_links.each do |link|
155
155
  linked_doc = link['doc']
156
156
  if !excluded_in_graph?(linked_doc.type)
@@ -42,10 +42,10 @@ module JekyllWikiLinks
42
42
  return nil
43
43
  end
44
44
 
45
- # 'bname' -> 'basename' (filename with extension)
45
+ # 'bname' -> 'basename' (filename with)
46
46
  def get_image_by_bname(filename)
47
47
  return nil if filename.nil? || @static_files.size == 0 || !SUPPORTED_IMG_FORMATS.any?{ |ext| ext == File.extname(filename).downcase }
48
- docs = @static_files.select{ |d| d.basename == filename[...-4] }
48
+ docs = @static_files.select{ |d| File.basename(d.relative_path) == filename }
49
49
  return nil if docs.nil? || docs.size > 1
50
50
  return docs[0]
51
51
  end
@@ -120,7 +120,8 @@ module JekyllWikiLinks
120
120
  lnk_doc_rel_url
121
121
  ) if wikilink.embedded?
122
122
  elsif (link_lvl == "header" && DocManager.doc_has_header?(linked_doc, wikilink.header_txt))
123
- lnk_doc_rel_url += "\#" + wikilink.header_txt.downcase
123
+ # from: https://github.com/jekyll/jekyll/blob/6855200ebda6c0e33f487da69e4e02ec3d8286b7/Rakefile#L74
124
+ lnk_doc_rel_url += "\#" + Jekyll::Utils.slugify(wikilink.header_txt)
124
125
  wikilink_inner_txt = "#{fname_inner_txt} > #{wikilink.header_txt}" if wikilink_inner_txt.nil?
125
126
  elsif (link_lvl == "block" && DocManager.doc_has_block_id?(linked_doc, wikilink.block_id))
126
127
  lnk_doc_rel_url += "\#" + wikilink.block_id.downcase
@@ -134,7 +135,7 @@ module JekyllWikiLinks
134
135
  end
135
136
  end
136
137
  end
137
-
138
+
138
139
  # the wikilink class knows everything about the original markdown syntax and its semantic meaning
139
140
  class WikiLink
140
141
  attr_accessor :embed, :link_type, :filename, :header_txt, :block_id, :label_txt
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllWikiLinks
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-wikilinks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - manunamz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-25 00:00:00.000000000 Z
11
+ date: 2021-07-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: