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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 297614cfe401bc3f0986b8c9f49cbc4622a75ce79358bdc8a83aa6530462d5f8
4
- data.tar.gz: 02756bf13129b0fcd51c01dfca7541022ab0f7dce6413022a8938d0ca4648a32
3
+ metadata.gz: 45d465d642bc399d4cf25b279d7f7388285efc94a2fec87dc0dcc8af973fb4f5
4
+ data.tar.gz: 402ae31641bf62beeb4639aa2dcae2bb557055905ac25e847af6e77be5dc0070
5
5
  SHA512:
6
- metadata.gz: e1ccf16cff3bbeee475cd8e62738275c6e616d07b1b88e8f4888ba98ac6e354f4ec2ff9a3b68ed73d8f24718f758514fd3f01a6dab8574dd30576aa450365346
7
- data.tar.gz: e775606702c59e24359d27f5e737a60221b31e36394bcc374f3dc9e35cbba1b68d57a160455acec7ed48ec615b603a7408e643c65a00d1246772784555bb8e11
6
+ metadata.gz: c8e32f01c8eacf08b4a9dcc731c83cd38b55593d7125afbc0527fda6ebc396c8589cc75b244eebdae9e9b6e70eb5e14a6b115532d6caae1fbcd3c6790705e407
7
+ data.tar.gz: 5d6e239b9e6e5c018a98d46e56a4816a60232171a71fd23f7baffd6f180931c077d9454b9c9856a64ffa032bc03e8c40149ed34970e83bc39ba5e3c67dac4d9a
data/README.md CHANGED
@@ -1 +1,9 @@
1
- # elixir-toolkit-theme-plugins
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
- 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,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><a href='#{tool["url"]} class='mt-2 me-2' '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")
60
- end
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
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class Ett
3
- VERSION = '0.1.5'
3
+ VERSION = '0.1.7'
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.5
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-06-20 00:00:00.000000000 Z
13
+ date: 2023-07-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: jekyll