# 个人资料中的可点击社交图标链接

**URL:** <https://meta.discourse.org/t/clickable-social-icon-links-on-profile/158136>\
**Category:** Theme component\
**Created:** [2020年七月18日 17:03 UTC](https://meta.discourse.org/t/clickable-social-icon-links-on-profile/158136 "2020-07-18T17:03:21Z")\
**Posts on this page:** 1\
**Showing post:** 97

<div class="post-metadata">

**Author:** ![jenmck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jenmck/32/332487_2.png) [@jenmck](https://meta.discourse.org/u/jenmck)\
**Post date:** [2025年十二月21日 20:45 UTC](https://meta.discourse.org/t/clickable-social-icon-links-on-profile/158136/97 "2025-12-21T20:45:29Z")

</div>

我遇到了一个问题，链接无法正确导航到用户的社交媒体个人资料。看起来它只是将您当前所在的页面的 URL 与自定义用户字段附加在一起。

到目前为止，我已经在 Steam 和 Discord 上注意到了这一点。

查看 [links-settings.js](https://github.com/weallwegot/discourse-social-links-clickable/blob/master/javascripts/discourse/services/links-settings.js) 中的 github 仓库，Steam 和 Discord 没有 `base:` 或 `baseregex:` 行……Bluesky 和 Twitter（抱歉，是“万物应用”X）工作正常，它们同时拥有这两行，所以这可能是问题所在？

```plaintext
{
        name: "Discord",
        icon: "fab-discord",
        link: {
          value: settings.discord_custom_field_name,
        },
      },
      {
        name: "Steam",
        icon: "fab-steam",
        link: {
          value: settings.steam_custom_field_name,
        },
      },

```

对于 Bluesky：

```plaintext
{
        name: "Bluesky",
        icon: "fab-bluesky",
        link: {
          value: settings.bluesky_custom_field_name,
          base: "https://bsky.app/profile/",
          baseregex: "^http(s)?://(www.)?bsky.app/profile/",
        },
      },

```

对于 Twitter：

```plaintext
{
        name: "X",
        icon: "fab-twitter",
        link: {
          value: settings.twitter_custom_field_name,
          base: "https://twitter.com/",
          baseregex: "^http(s)?://(www.)?twitter.com/",
        },
      },

```

快速浏览了其余的条目，看起来这些也没有 `base:` 或 `baseregex:` 行，但我没有它们的实时示例来测试。

- 电子邮件
- Mastodon
- Discord
- Steam
- LinkedIn
- Bandcamp

（编辑以添加）我已经创建了一个 [pull request](https://github.com/weallwegot/discourse-social-links-clickable/pull/22)：  
[09096b8](https://github.com/weallwegot/discourse-social-links-clickable/pull/22/commits/09096b8726cf03f28ae6858acf5d2c6f9185b577)：为电子邮件、Steam 和 LinkedIn 添加基础 URL  
[0ec40a0](https://github.com/weallwegot/discourse-social-links-clickable/pull/22/commits/0ec40a0c30cff19c5e32550cc458fe46034b47a2)：添加了 Discord、Bandcamp 和 Mastodon，并更新了自述文件。我单独做了这个，因为 Bandcamp 和 Mastodon 的基础 URL 会根据用户而有所不同，它们不一致；对于 Discord，用户输入的是他们的用户 ID 而不是用户名，所以我觉得需要在自述文件中解释一下。

---

_[View the full topic](https://meta.discourse.org/t/clickable-social-icon-links-on-profile/158136)._
