{{< details >}}

  • Tier: 基础版,专业版,旗舰版
  • Offering: JihuLab.com, 私有化部署

{{< /details >}}

{{< history >}}

  • 引入于极狐GitLab 13.6,使用名为 custom_emoji功能标志。默认禁用。
  • 在极狐GitLab 14.0 上为 JihuLab.com 启用。
  • 在极狐GitLab 16.7 为私有化部署启用。
  • 在极狐GitLab 16.9 中 GA。功能标志 custom_emoji 被移除。

{{< /history >}}

要在评论和描述中使用 自定义表情,您可以通过使用 GraphQL API 将它们添加到顶级群组。

创建自定义表情

mutation CreateCustomEmoji($groupPath: ID!) {
  createCustomEmoji(input: {groupPath: $groupPath, name: "party-parrot", url: "https://cultofthepartyparrot.com/parrots/hd/parrot.gif"}) {
    clientMutationId
    customEmoji {
      name
    }
    errors
  }
}

在您将自定义表情添加到群组之后,成员可以像在评论中使用其他表情一样使用它。

属性

查询接受这些属性:

属性 类型 是否必需 描述
group_path 整数/字符串 顶级群组的 ID 或 URL 编码路径
name 字符串 自定义表情的名称。
file 字符串 自定义表情图片的 URL。

使用 GraphiQL

您可以使用 GraphiQL 查询群组的表情。

  1. 打开 GraphiQL:
    • 对于 JihuLab.com,使用:https://gitlab.com/-/graphql-explorer
    • 对于 极狐GitLab 私有化部署,使用:https://gitlab.example.com/-/graphql-explorer
  2. 复制以下文本并粘贴到左侧窗口。在此查询中,gitlab-org 是群组路径。

        query GetCustomEmoji {
          group(fullPath: "gitlab-org") {
            id
            customEmoji {
              nodes {
                name,
                url
              }
            }
          }
        }
    
  3. 选择 播放

相关主题