[openstreetmap/openstreetmap-website] Add social profile links (PR #5439)
David Tsiklauri
notifications at github.com
Thu Feb 20 07:08:09 UTC 2025
@nertc 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 }
`http(s)://` is now removed in the list. I was also thinking about removing `www.`. What do you think about it?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r1962969038
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5439/review/2628888066 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250219/5a54c8ec/attachment.htm>
More information about the rails-dev
mailing list