jekyll-wikilinks 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll-wikilinks/plugins/filter.rb +19 -13
- data/lib/jekyll-wikilinks/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: eb34f22e418709f097d81cbcd13a0917ab903247145bb0db4846a346c0b86f38
|
4
|
+
data.tar.gz: 62bff9a52a5e965a542071a0d577ea3a962c3acd604643d0955de449e924de7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '087c441fc74aa0da7659bf070eb3c2b079033d8a567002e00603825498afb6ef30d259372e18799506e4fc2b7b3cc3c3501f0a67dd4e559eefd463214ee6a502'
|
7
|
+
data.tar.gz: 8abe1efd8a9b2eecd13b1d83599c09ee29db9e2e943ed097bf49aa000fd1a6caea2c6cedc1bb05fdce6fb4bfa3d1852b01221420e91f647d8aff61b7bce6ac50
|
@@ -38,8 +38,8 @@ module Jekyll
|
|
38
38
|
return links_of_type.uniq
|
39
39
|
end
|
40
40
|
|
41
|
-
# usage: {% assign author_links = page.links |
|
42
|
-
def
|
41
|
+
# usage: {% assign author_links = page.links | link_type: "author" %}
|
42
|
+
def link_type(links, link_type)
|
43
43
|
Jekyll.logger.error("Jekyll-Wikilinks: 'links' invalid") if links.nil?
|
44
44
|
Jekyll.logger.error("Jekyll-Wikilinks: 'link_type' invalid") if link_type.nil?
|
45
45
|
return [] if links.empty?
|
@@ -48,22 +48,28 @@ module Jekyll
|
|
48
48
|
|
49
49
|
links_of_type = []
|
50
50
|
links.each do |l|
|
51
|
-
if l.
|
52
|
-
|
51
|
+
if l['type'].to_s == link_type.to_s
|
52
|
+
# links
|
53
|
+
if l.keys.include?('url')
|
53
54
|
docs = site.documents.select{ |d| d.url == l['url'] }
|
54
|
-
if !doc.nil? &&
|
55
|
+
if !doc.nil? && docs.size != 1
|
55
56
|
links_of_type << l
|
56
57
|
end
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
58
|
+
# attributes
|
59
|
+
elsif l.keys.include?('urls')
|
60
|
+
all_docs_exist = true
|
61
|
+
l['urls'].each do |lurl|
|
62
|
+
docs = site.documents.select{ |d| d.url == lurl }
|
63
|
+
if !docs.nil? && docs.size != 1
|
64
|
+
all_docs_exist = false
|
65
|
+
end
|
63
66
|
end
|
67
|
+
if all_docs_exist
|
68
|
+
links_of_type << l
|
69
|
+
end
|
70
|
+
else
|
71
|
+
Jekyll.logge.error("Jekyll-Wikilinks: In 'link_type' filter, 'links' do not have 'url' or 'urls'")
|
64
72
|
end
|
65
|
-
else
|
66
|
-
Jekyll.logge.error("Jekyll-Wikilinks: In 'rel_type' filter, 'links' do not have 'url' or 'urls'")
|
67
73
|
end
|
68
74
|
end
|
69
75
|
return links_of_type.uniq
|
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
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- manunamz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|