정규화된 프로필 링크

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. (:person_shrugging:)

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 Grey Arrows Drone Club for funding initial development!

14개의 좋아요

I’m not sure how to get the icons to show? I tried creating a custom user field, but I don’t think that’s how it’s done?

@NateDhaliwal if it helps, here’s the custom user field settings we have for YouTube, also make sure the two Show on... settings are not checked:

Here are the settings used on this theme component for YouTube:

The end result when viewing a user profile:

2개의 좋아요

I see, I had it checked.
I did exactly what you did, but my Github icon isn’t showing.



In the component settings, your input for the field name is “GitHub”, but above the name of the field is “Github”. Maybe it will work if they are the same.

4개의 좋아요

It now works. Thanks a bunch!

3개의 좋아요

안녕하세요, 이 컴포넌트에 대한 경고가 콘솔에 표시되고 있습니다. 업데이트가 가능한가요?

감사합니다.

1개의 좋아요

배열 비추천 사항에 대한 수정 사항이 포함된 PR을 올렸습니다.

4개의 좋아요

고마워, 릴리! 방금 병합했어!

3개의 좋아요

훌륭하네요, 감사합니다 :person_bowing:

저도 방금 제 Discourse에서 업데이트를 마쳤습니다. 모든 것이 정상입니다 :partying_face:

1개의 좋아요

어느 날은 v0.0.2까지 도달하게 될 거예요 :grin:

2개의 좋아요

기대해 볼 만한 일이죠!

3개의 좋아요