From 7be6be0dee66bdcec08cc9c2b9c0041ffb691e89 Mon Sep 17 00:00:00 2001 From: bedroesb Date: Tue, 20 Jun 2023 11:53:46 +0200 Subject: [PATCH 1/2] strip --- lib/elixir-toolkit-theme-plugins/tool_tag.rb | 2 +- lib/elixir-toolkit-theme-plugins/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/elixir-toolkit-theme-plugins/tool_tag.rb b/lib/elixir-toolkit-theme-plugins/tool_tag.rb index 11e1ea7..9c3c215 100644 --- a/lib/elixir-toolkit-theme-plugins/tool_tag.rb +++ b/lib/elixir-toolkit-theme-plugins/tool_tag.rb @@ -34,7 +34,7 @@ def render(context) end def find_tool(tool_id) - tool = @tools.find { |t| t["id"] == tool_id } + tool = @tools.find { |t| t["id"] == tool_id.strip } return tool if tool raise Exception.new "Undefined tool ID: #{tool_id}" diff --git a/lib/elixir-toolkit-theme-plugins/version.rb b/lib/elixir-toolkit-theme-plugins/version.rb index 0db1f43..9c1424e 100644 --- a/lib/elixir-toolkit-theme-plugins/version.rb +++ b/lib/elixir-toolkit-theme-plugins/version.rb @@ -1,5 +1,5 @@ module Jekyll class Ett - VERSION = '0.1.5' + VERSION = '0.1.6' end end From 2d23eb2b4b11f5983726af775cd2db629a5cb596 Mon Sep 17 00:00:00 2001 From: bedroesb Date: Tue, 20 Jun 2023 12:00:39 +0200 Subject: [PATCH 2/2] correct spacing --- lib/elixir-toolkit-theme-plugins/tool_tag.rb | 35 ++++++++++---------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/lib/elixir-toolkit-theme-plugins/tool_tag.rb b/lib/elixir-toolkit-theme-plugins/tool_tag.rb index 44e7716..346747f 100644 --- a/lib/elixir-toolkit-theme-plugins/tool_tag.rb +++ b/lib/elixir-toolkit-theme-plugins/tool_tag.rb @@ -17,9 +17,7 @@ def load_tools def render(context) tool = find_tool(context[@content.strip]) - if tool["registry"] - tags = create_tags(tool["registry"]) - end + tags = create_tags(tool) %Q{
#{tool["description"]}
Website#{tags}" + data-bs-content="
#{tool["name"]}
#{tool["description"]}
#{tags}" data-bs-template="" data-bs-html="true" >#{ tool["name"] }} @@ -40,25 +38,28 @@ def find_tool(tool_id) raise Exception.new "Undefined tool ID: #{tool_id}" end - def create_tags(registry) + def create_tags(tool) tags = "" + tags << create_tag("#{tool["url"]}", "fa-link", "Website") + if tool["registry"] + registry = tool["registry"] - if registry["biotools"] - tags << create_tag("https://bio.tools/#{registry["biotools"]}", "fa-info", "Tool info") - end + if registry["biotools"] + tags << create_tag("https://bio.tools/#{registry["biotools"]}", "fa-info", "Tool info") + end - if registry["fairsharing"] - tags << create_tag("https://fairsharing.org/FAIRsharing.#{registry["fairsharing"]}", "fa-database", "Standards/Databases") - end + if registry["fairsharing"] + tags << create_tag("https://fairsharing.org/FAIRsharing.#{registry["fairsharing"]}", "fa-database", "Standards/Databases") + end - if registry["fairsharing-coll"] - tags << create_tag("https://fairsharing.org/#{registry["fairsharing-coll"]}", "fa-database", "Standards/Databases") - end + if registry["fairsharing-coll"] + tags << create_tag("https://fairsharing.org/#{registry["fairsharing-coll"]}", "fa-database", "Standards/Databases") + end - if registry["tess"] - tags << create_tag("https://tess.elixir-europe.org/search?q=#{registry["tess"]}", "fa-graduation-cap", "Training") + if registry["tess"] + tags << create_tag("https://tess.elixir-europe.org/search?q=#{registry["tess"]}", "fa-graduation-cap", "Training") + end end - tags end