Open links to social networks in the same window

As mentioned in earlier commits, opening external links in a new
tab/window results in usability and accessibility issues.

Since these links are usually at the top or bottom of the page and
contain icons of well-known sites, IMHO there's no need to even notify
people that these are external links.

Since we're no longer using the `shared.target_blank` translation inside
a sentence, we can remove the space and parenthesis in the translations.
This commit is contained in:
Javi Martín
2023-10-15 16:47:53 +02:00
parent 44f4bdf772
commit 56d834783c
5 changed files with 5 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
<ul>
<% sites.each do |name, url| %>
<li>
<%= link_to "#{url}/#{setting["#{name}_handle"]}", target: "_blank", title: link_title(name) do %>
<%= link_to "#{url}/#{setting["#{name}_handle"]}", title: link_title(name) do %>
<span class="show-for-sr"><%= link_text(name) %></span>
<span class="icon-<%= name %>" aria-hidden="true"></span>
<% end %>

View File

@@ -18,7 +18,7 @@ class Layout::SocialComponent < ApplicationComponent
end
def link_title(site_name)
t("shared.go_to_page") + link_text(site_name) + t("shared.target_blank")
t("shared.go_to_page") + link_text(site_name)
end
def link_text(site_name)