Summary | Add links to user card and profile | |
Repository | GitHub - literatecomputing/normalized-profile-links: Add profile links and normalize the user part (e.g., make https://twitter.com/user or @user both be user) | |
Install Guide | How to install a theme or theme component | |
New to Discourse Themes? | Beginner’s guide to using Discourse Themes |
Install this theme component
Add user_custom_field
links to user card and profile and attempt to deal with bad user entries. Allow adding links to arbitrary sites.
For example, a user might enter any of these for Twitter (X):
https://x.com/MyHandle
https://twitter.com/MyHandle
https://www.twitter.com/MyHandle
x.com/MyHandle
twitter.com/MyHandle
/MyHandle
@MyHandle
MyHandle
This theme component will make all of those become “MyHandle”, so if a user enters any of those in the twitter field, the link will become https://x.com/MyHandle
. For a site like YouTube where an @ is needed in the URL for the profile link, you need to make the link URL be https://youtube.com/@', so that the link will become
https://youtube.com/@MyHandle`. I considered making the @
be part of the handle, but that makes breaks things if a user enters @literatecomputing.com
as their BlueSky handle since BlueSky wants the profile URL to be https://bsky.app/profile/literatecomputing.com
with no @
.
Settings allow adding any site you wish that has some kind of handle that can be appended to some URL.
Note that the custom_field_name
and link name are case sensitive. I considered trying to fix this but it was a pain and I decided that admins can deal with making the case match. (Thanks to @NateDhaliwal for trying the theme component and to @Moin and @Richie for pointing out that case sensitivity was an issue.)
If you require additional Font Awesome Icons you can add them to the Additional Icons setting.
A bunch of the sample settings (and associated icons) are provided by AI completion and not tested. You can make changes to the settings yourself, but if you let me know about a broken one (via email or PR) I will be happy to fix it.
Another feature I have considered is making it possible to have entries appear on only the User Card or User Profile, rather than both. If that’s of interest, please let me know, especially if you have a budget.
Why Yet Another Custom Field Theme Component?
The Official Custom Profile Link adds a link for only one custom field. ()
Multiple Custom Profile Links is similar to this, but this component adds
- a simpler customization interface,
- some error checking/fixing of users adding semi-bogus entries,
- and the ability to add links to custom services/sites.
Thanks to Gray Arrows Drone Club for funding initial development!