]> 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

app/assets/images/social_icons/bluesky.svg [new file with mode: 0644]
config/locales/en.yml
lib/social_share_button_helper.rb

diff --git a/app/assets/images/social_icons/bluesky.svg b/app/assets/images/social_icons/bluesky.svg
new file mode 100644 (file)
index 0000000..7e7c880
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg width="625" height="625" viewBox="0 0 800 800" xmlns="http://www.w3.org/2000/svg">
+  <circle cx="400" cy="400" r="400" fill="#1185fe" />
+  <path d="m 239.121,183.60504 c 65.12,48.8889 135.16,148.0173 160.879,201.2093 25.719,-53.192 95.759,-152.3204 160.879,-201.2093 46.987,-35.27553 123.121,-62.5701 123.121,24.2827 0,17.3452 -9.945,145.7126 -15.778,166.5546 -20.275,72.453 -94.155,90.933 -159.875,79.748 114.875,19.551 144.097,84.311 80.986,149.071 -119.86,122.992 -172.272,-30.859 -185.702,-70.281 -2.462,-7.227 -3.614,-10.608 -3.631,-7.733 -0.017,-2.875 -1.169,0.506 -3.631,7.733 -13.43,39.422 -65.842,193.273 -185.7023,70.281 -63.1111,-64.76 -33.8889,-129.52 80.9863,-149.071 -65.72,11.185 -139.5995,-7.295 -159.8752,-79.748 C 125.94525,353.60034 116,225.23294 116,207.88774 c 0,-86.8528 76.1345,-59.55823 123.121,-24.2827 z" fill="#ffffff" />
+</svg>
index 16bef0bd0919a0a803b4f19dc49b34032be835b2..0e7946c0faa89954dd1c185023296859fbcc4274 100644 (file)
@@ -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
index 2e822ecb872002c51a7a8d66ae43ae61efb3bdb6..9dac9a6c8a08e917d8348540375f4c951449930c 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