Skip to content

Commit

Permalink
Add Bluesky to social sharing buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Dec 18, 2024
1 parent 6094a97 commit 7a2e53c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/assets/images/social_icons/bluesky.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/social_share_button_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -44,6 +45,8 @@ def self.generate_share_url(site, params)
"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
Expand Down

0 comments on commit 7a2e53c

Please sign in to comment.