elixir-toolkit-theme-plugins 0.1.4 → 0.1.6

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: 51b1e1c34269978fe9a4fbce7cfec054afab7249dca681e6c416853e657927d0
4
- data.tar.gz: 44d34321341962899b93dba6359c6f726542e78342d4026aa6f4b6c079069674
3
+ metadata.gz: cdbdcaaaa830ab26f33c67e051eb63864358ede91a343d8e237c91bdd516e964
4
+ data.tar.gz: 764c8e2f62e4f83bde63934831a5a7f9b1f78f3dcb9afe17cc5e474b0960224f
5
5
  SHA512:
6
- metadata.gz: 96fd0740e7d3501f4d856f72d074bf6d195fdd943a30b9d6b47eade263775a4033dcd92ef21b143c812553f5ce6298a812d2b0e1be0b5fb01ba8f80a410b5e5e
7
- data.tar.gz: f1fa1db24d8fdb85395e3845143f4ba050122c04fc522eca75226eead75486ffeee05cff2246c1aefece3c5fa4d14ad715541a935787b056af88e664b87a99f5
6
+ metadata.gz: 7df048eefc8c02f9f3905cea3c2df19f7b68aa8db496a85fe077ad1f990f90fa9d6f570d2074223d6c04dc18d1ee671c78ca41ca160bb04a6121841df0e9d876
7
+ data.tar.gz: 51486d5390e32e23e63f07f37a315f6faf84a351000a1bb0ea7a74a0b2e1f99a710f8fb7076223487513472591ccd28b88e5bed570c40e1cc5fb7d7f49094a74
@@ -17,9 +17,7 @@ module Jekyll
17
17
 
18
18
  def render(context)
19
19
  tool = find_tool(context[@content.strip])
20
- if tool["registry"]
21
- tags = create_tags(tool["registry"])
22
- end
20
+ tags = create_tags(tool)
23
21
  %Q{<a
24
22
  tabindex="0"
25
23
  class="tool"
@@ -27,38 +25,41 @@ module Jekyll
27
25
  data-bs-toggle="popover"
28
26
  data-bs-placement="bottom"
29
27
  data-bs-trigger="focus"
30
- data-bs-content="<h5>#{tool["name"]}</h5><div class='mb-2'>#{tool["description"]}</div><a href='#{tool["url"]}'target='_blank'><span class='badge bg-dark text-white hover-primary'><i class='fa-solid fa-link me-2'></i>Website</span></a>#{tags}"
28
+ data-bs-content="<h5>#{tool["name"]}</h5><div class='mb-2'>#{tool["description"]}</div>#{tags}"
31
29
  data-bs-template="<div class='popover popover-tool' role='tooltip'><div class='popover-arrow'></div><h3 class='popover-header'></h3><div class='popover-body'></div></div>"
32
30
  data-bs-html="true"
33
31
  ><i class="fa-solid fa-wrench me-2"></i>#{ tool["name"] }</a>}
34
32
  end
35
33
 
36
34
  def find_tool(tool_id)
37
- tool = @tools.find { |t| t["id"] == tool_id }
35
+ tool = @tools.find { |t| t["id"] == tool_id.strip }
38
36
  return tool if tool
39
37
 
40
38
  raise Exception.new "Undefined tool ID: #{tool_id}"
41
39
  end
42
40
 
43
- def create_tags(registry)
41
+ def create_tags(tool)
44
42
  tags = ""
43
+ tags << create_tag("#{tool["url"]}", "fa-link", "Website")
44
+ if tool["registry"]
45
+ registry = tool["registry"]
45
46
 
46
- if registry["biotools"]
47
- tags << create_tag("https://bio.tools/#{registry["biotools"]}", "fa-info", "Tool info")
48
- end
47
+ if registry["biotools"]
48
+ tags << create_tag("https://bio.tools/#{registry["biotools"]}", "fa-info", "Tool info")
49
+ end
49
50
 
50
- if registry["fairsharing"]
51
- tags << create_tag("https://fairsharing.org/FAIRsharing.#{registry["fairsharing"]}", "fa-database", "Standards/Databases")
52
- end
51
+ if registry["fairsharing"]
52
+ tags << create_tag("https://fairsharing.org/FAIRsharing.#{registry["fairsharing"]}", "fa-database", "Standards/Databases")
53
+ end
53
54
 
54
- if registry["fairsharing-coll"]
55
- tags << create_tag("https://fairsharing.org/#{registry["fairsharing-coll"]}", "fa-database", "Standards/Databases")
56
- end
55
+ if registry["fairsharing-coll"]
56
+ tags << create_tag("https://fairsharing.org/#{registry["fairsharing-coll"]}", "fa-database", "Standards/Databases")
57
+ end
57
58
 
58
- if registry["tess"]
59
- tags << create_tag("https://tess.elixir-europe.org/search?q=#{registry["tess"]}", "fa-graduation-cap", "Training")
59
+ if registry["tess"]
60
+ tags << create_tag("https://tess.elixir-europe.org/search?q=#{registry["tess"]}", "fa-graduation-cap", "Training")
61
+ end
60
62
  end
61
-
62
63
  tags
63
64
  end
64
65
 
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class Ett
3
- VERSION = '0.1.4'
3
+ VERSION = '0.1.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elixir-toolkit-theme-plugins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - bedroesb
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-05-04 00:00:00.000000000 Z
13
+ date: 2023-06-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: jekyll