-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Changes this field to render a link rather than a facet. * Overrides renderer file so that external link opens in new tab. * Fixes ruby syntax that circle ci didn't like * Gives renderer a variable.
- Loading branch information
Showing
2 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
app/renderers/hyrax/renderers/external_link_attribute_renderer.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# <!-- Hyrax v5.0.1 Override: added functionality so that the external link opens in a new tab. --> | ||
# frozen_string_literal: true | ||
module Hyrax | ||
module Renderers | ||
class ExternalLinkAttributeRenderer < AttributeRenderer | ||
private | ||
|
||
def li_value(value) | ||
auto_link(value, :urls, target: "_blank", rel: "noopener noreferrer") do |link| | ||
"<span class='fa fa-external-link'></span> #{link}" | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters