]> git.openstreetmap.org Git - rails.git/commitdiff
Merge pull request #5411 from tomhughes/bluesky-sharing
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 18 Dec 2024 15:06:18 +0000 (15:06 +0000)
committerGitHub <noreply@github.com>
Wed, 18 Dec 2024 15:06:18 +0000 (15:06 +0000)
Add Bluesky to social sharing buttons

1  2 
lib/social_share_button_helper.rb

index 2e822ecb872002c51a7a8d66ae43ae61efb3bdb6,b45c7933a54dc40714626cbb4ace19530625c309..9dac9a6c8a08e917d8348540375f4c951449930c
@@@ -3,6 -3,7 +3,7 @@@ module SocialShareButtonHelpe
  
    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",
      when :linkedin
        "https://www.linkedin.com/sharing/share-offsite/?url=#{URI.encode_www_form_component(params[:url])}"
      when :facebook
 -      "https://www.facebook.com/sharer/sharer.php?u=#{URI.encode_www_form_component('params[:url]')}&t=#{URI.encode_www_form_component(params[:title])}"
 +      "https://www.facebook.com/sharer/sharer.php?u=#{URI.encode_www_form_component(params[:url])}&t=#{URI.encode_www_form_component(params[:title])}"
      when :mastodon
        "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