]> git.openstreetmap.org Git - rails.git/blobdiff - lib/social_share_button_helper.rb
Add Bluesky to social sharing buttons
[rails.git] / lib / social_share_button_helper.rb
index fe47c6ca15d435d8718ad5d08eb3dcbf973280c9..b45c7933a54dc40714626cbb4ace19530625c309 100644 (file)
@@ -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