Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Swap for semantic a, provide href" #4768

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions _plugins/jekyll-tool-tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,21 @@ def render(context)
# check if a variable was provided for the tool id
tool = context[m[2].tr('{}', '')] || m[2]
version = tool.split('/').last
# url encode
q = URI.encode_www_form_component("?tool_id=#{tool}")
tool_redirect = "https://my.galaxy.training/?path=#{q}"

if tool.count('/').zero?
"<a class=\"tool\" data-tool=\"#{tool}\" title=\"#{m[1]} tool\" href=\"#{tool_redirect}\">" \
"<span class=\"tool\" data-tool=\"#{tool}\" title=\"#{m[1]} tool\" aria-role=\"button\">" \
'<i class="fas fa-wrench" aria-hidden="true"></i> ' \
"<strong>#{m[1]}</strong>" \
'</a>'
'</span>'
else
"<a class=\"tool\" data-tool=\"#{tool}\" title=\"#{m[1]} tool\" href=\"#{tool_redirect}\">" \
"<span class=\"tool\" data-tool=\"#{tool}\" title=\"#{m[1]} tool\" aria-role=\"button\">" \
'<i class="fas fa-wrench" aria-hidden="true"></i> ' \
"<strong>#{m[1]}</strong> " \
'(' \
'<i class="fas fa-cubes" aria-hidden="true"></i> ' \
"Galaxy version #{version}" \
')' \
'</a>'
'</span>'
end
else
%(<span><strong>#{@text}</strong> <i class="fas fa-wrench" aria-hidden="true"></i></span>)
Expand Down
Loading