From: Andy Allan Date: Wed, 18 Dec 2024 15:06:18 +0000 (+0000) Subject: Merge pull request #5411 from tomhughes/bluesky-sharing X-Git-Tag: live~512 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/a012c5ecee85949f0a84093c7edfdd90d192768f?hp=918370b7a87451d185981a6c113eed6411bcc5fc Merge pull request #5411 from tomhughes/bluesky-sharing Add Bluesky to social sharing buttons --- diff --git a/app/assets/images/social_icons/bluesky.svg b/app/assets/images/social_icons/bluesky.svg new file mode 100644 index 000000000..7e7c880d7 --- /dev/null +++ b/app/assets/images/social_icons/bluesky.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/config/locales/en.yml b/config/locales/en.yml index 16bef0bd0..0e7946c0f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2632,6 +2632,9 @@ en: email: title: Share via Email alt: Email icon + bluesky: + title: Share via Bluesky + alt: Bluesky Icon facebook: title: Share via Facebook alt: Facebook Icon diff --git a/lib/social_share_button_helper.rb b/lib/social_share_button_helper.rb index 2e822ecb8..9dac9a6c8 100644 --- a/lib/social_share_button_helper.rb +++ b/lib/social_share_button_helper.rb @@ -3,6 +3,7 @@ module SocialShareButtonHelper SOCIAL_SHARE_CONFIG = { :email => "social_icons/email.svg", + :bluesky => "social_icons/bluesky.svg", :facebook => "social_icons/facebook.svg", :linkedin => "social_icons/linkedin.svg", :mastodon => "social_icons/mastodon.svg", @@ -44,6 +45,8 @@ module SocialShareButtonHelper "https://mastodonshare.com/?text=#{URI.encode_www_form_component(params[:title])}&url=#{URI.encode_www_form_component(params[:url])}" when :telegram "https://t.me/share/url?url=#{URI.encode_www_form_component(params[:url])}&text=#{URI.encode_www_form_component(params[:title])}" + when :bluesky + "https://bsky.app/intent/compose?text=#{URI.encode_www_form_component(params[:title])}+#{URI.encode_www_form_component(params[:url])}" else raise ArgumentError, "Unsupported platform: #{platform}" end