openstreetmap-website
openstreetmap-website copied to clipboard
Add social sharing functionality
Add social network sharing to diary entry pages
Description: This PR addresses the issue #1391 by introducing social media sharing functionality for diary entries, allowing users to share posts on platforms like Twitter, Facebook, LinkedIn, Mastodon, Telegram, and Email. It includes required JavaScript to handle opening share URLs in pop-up windows and Ruby helper methods to filter and validate allowed social media sites. The changes also incorporate error logging for invalid sites and missing icons, ensuring robustness.
Implementation details:
-
lib/social_share_button_helper.rb
- config, validation & helper functions -
render_social_share_buttons
function insideapplication_helper.rb
responsible for rendering the buttons with helper utilization -
social_share_button.js
- javascript utility functions for opening the popups, generating urls for sharing & handling onclick events on buttons
Screenshots:
Reviews welcome, Thank you.