elixir-toolkit-theme-plugins 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -1
- data/lib/elixir-toolkit-theme-plugins/tool_tag.rb +25 -19
- data/lib/elixir-toolkit-theme-plugins/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: 45d465d642bc399d4cf25b279d7f7388285efc94a2fec87dc0dcc8af973fb4f5
|
4
|
+
data.tar.gz: 402ae31641bf62beeb4639aa2dcae2bb557055905ac25e847af6e77be5dc0070
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8e32f01c8eacf08b4a9dcc731c83cd38b55593d7125afbc0527fda6ebc396c8589cc75b244eebdae9e9b6e70eb5e14a6b115532d6caae1fbcd3c6790705e407
|
7
|
+
data.tar.gz: 5d6e239b9e6e5c018a98d46e56a4816a60232171a71fd23f7baffd6f180931c077d9454b9c9856a64ffa032bc03e8c40149ed34970e83bc39ba5e3c67dac4d9a
|
data/README.md
CHANGED
@@ -1 +1,9 @@
|
|
1
|
-
#
|
1
|
+
# ELIXIR Toolkit Theme Plugins
|
2
|
+
|
3
|
+
Here we collect scripts to add aditional features to the [ELIXIR Toolkit Theme](https://github.com/ELIXIR-Belgium/elixir-toolkit-theme).
|
4
|
+
|
5
|
+
This features include:
|
6
|
+
|
7
|
+
* An improved way of tagging tools from a central tools table in the content of a page.
|
8
|
+
* Making sure the correct Git branch is detected when the theme is being deployed.
|
9
|
+
|
@@ -17,9 +17,7 @@ module Jekyll
|
|
17
17
|
|
18
18
|
def render(context)
|
19
19
|
tool = find_tool(context[@content.strip])
|
20
|
-
|
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,43 +25,51 @@ 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
|
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(
|
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
|
-
|
47
|
-
|
48
|
-
|
47
|
+
if registry["biotools"]
|
48
|
+
tags << create_tag("https://bio.tools/#{registry["biotools"]}", "fa-info", "Tool info")
|
49
|
+
end
|
49
50
|
|
50
|
-
|
51
|
-
|
52
|
-
|
51
|
+
if registry["fairsharing"]
|
52
|
+
tags << create_tag("https://fairsharing.org/FAIRsharing.#{registry["fairsharing"]}", "fa-database", "Standards/Databases")
|
53
|
+
end
|
53
54
|
|
54
|
-
|
55
|
-
|
56
|
-
|
55
|
+
if registry["fairsharing-coll"]
|
56
|
+
tags << create_tag("https://fairsharing.org/#{registry["fairsharing-coll"]}", "fa-database", "Standards/Databases")
|
57
|
+
end
|
57
58
|
|
58
|
-
|
59
|
-
|
60
|
-
|
59
|
+
if registry["tess"]
|
60
|
+
tags << create_tag("https://tess.elixir-europe.org/search?q=#{registry["tess"]}", "fa-graduation-cap", "Training")
|
61
|
+
end
|
61
62
|
|
63
|
+
if registry["europmc"]
|
64
|
+
tags << create_tag("https://europepmc.org/article/MED/#{registry["europmc"]}", "fa-book", "Publication")
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
62
68
|
tags
|
63
69
|
end
|
64
70
|
|
65
71
|
def create_tag(url, icon, label)
|
66
|
-
"<a href='#{url}' class='mt-2 me-2'><span class='badge bg-dark text-white hover-primary'><i class='fa-solid #{icon} me-2'></i>#{label}</span></a>"
|
72
|
+
"<a href='#{url}' target='_blank' rel='noopener' class='mt-2 me-2'><span class='badge bg-dark text-white hover-primary'><i class='fa-solid #{icon} me-2'></i>#{label}</span></a>"
|
67
73
|
end
|
68
74
|
end
|
69
75
|
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
|
+
version: 0.1.7
|
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-
|
13
|
+
date: 2023-07-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: jekyll
|