sources: add artist profile links to fetch source data box.

Add site icons linking to all the artist's sites in the fetch source
data box.

Some artist entries have a large number of URLs. Various heuristics are
applied to try to present the most useful URLs first. Dead URLs and
redundant URLs (Pixiv stacc and Twitter intent URLs) are filtered out.
Remaining URLs are sorted first by site (to put sites like Pixiv and
Twitter first), then by URL (to break ties when an artist has multiple
accounts on the same site).

Some sites have shitty hard-to-read icons. It can't be helped. The icons
are the official favicons of each site.
This commit is contained in:
evazion
2021-02-26 01:04:44 -06:00
parent e1ef94faf7
commit 7b60a476e5
35 changed files with 248 additions and 64 deletions

View File

@@ -6,17 +6,17 @@
<span class="social-icons">
<% if Danbooru.config.source_code_url.present? %>
<%= link_to Danbooru.config.source_code_url, title: "Running commit: #{Rails.application.config.x.git_hash&.first(9)}", class: "social-icon" do %>
<img src="/images/github-logo.png">
<%= github_icon %>
<% end %>
<% end %>
<% if Danbooru.config.twitter_username.present? %>
<%= link_to "https://twitter.com/#{Danbooru.config.twitter_username}", class: "social-icon" do %>
<img src="/images/twitter-logo.png">
<%= twitter_icon %>
<% end %>
<% end %>
<% if Danbooru.config.discord_server_url.present? %>
<%= link_to Danbooru.config.discord_server_url, class: "social-icon" do %>
<img src="/images/discord-logo.png">
<%= discord_icon %>
<% end %>
<% end %>
</span>