[openstreetmap/openstreetmap-website] Add social profile links (PR #5439)

Holger Jeromin notifications at github.com
Thu Feb 20 07:12:39 UTC 2025


@HolgerJeromin commented on this pull request.



> +    :bluesky => %r{\Ahttps?://(?:www\.)?bsky\.app/profile/([a-zA-Z0-9\._-]+)}
+  }.freeze
+
+  NO_USERNAME_PLATFORMS = %w[discord line skype slack].freeze
+
+  def parsed
+    URL_PATTERNS.each do |platform, pattern|
+      names = url.match(pattern)
+      if names
+        return {
+          :platform => platform.to_s,
+          :name => NO_USERNAME_PLATFORMS.include?(platform.to_s) ? platform.to_s.capitalize : names[1]
+        }
+      end
+    end
+    { :platform => nil, :name => url }

I always hate if browsers liying about the real url, but here this is probably a good idea.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r1962973880
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5439/review/2628895699 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250219/48fd14dc/attachment.htm>


More information about the rails-dev mailing list