# 如何使用 SVG 设置群组徽章？

**URL:** <https://meta.discourse.org/t/how-to-use-svg-for-group-flair/157252>\
**Category:** Support\
**Created:** [2020年七月9日 11:56 UTC](https://meta.discourse.org/t/how-to-use-svg-for-group-flair/157252 "2020-07-09T11:56:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesmarkcook](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamesmarkcook/32/168563_2.png) [@jamesmarkcook](https://meta.discourse.org/u/jamesmarkcook)\
**Post date:** [2020年七月9日 11:56 UTC](https://meta.discourse.org/t/how-to-use-svg-for-group-flair/157252/1 "2020-07-09T11:56:00Z")

</div>

我注意到 Meta 上的团队徽章使用了 Discourse 的 SVG 图标。

我成功在我的主题中上传了一个自定义 SVG 精灵，以便为群组徽章使用自定义图标，但这似乎不允许你以完整的徽章尺寸使用 SVG 图标，它默认认为你希望将其作为徽章圆圈内的小图标。

唯一的另一个选项是上传为图像（jpg、png 等）。它不支持 SVG。

如果能知道 Meta 上是如何实现的就太好了。

---

<div class="post-metadata">

**Author:** ![jamesmarkcook](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamesmarkcook/32/168563_2.png) [@jamesmarkcook](https://meta.discourse.org/u/jamesmarkcook)\
**Post date:** [2020年七月9日 11:58 UTC](https://meta.discourse.org/t/how-to-use-svg-for-group-flair/157252/2 "2020-07-09T11:58:16Z")

</div>

看起来您以前可以指定一个 flair 图片的 URL。现在创建群组时，我已找不到该选项。

> [@Supported formats / sizes for Group Flair URL?](https://meta.discourse.org/t/supported-formats-sizes-for-group-flair-url/102472/2?u=jamesmarkcook):
>
> Welcome! For images: your best bet is to use a square image, 32x32 or 64x64 should be sufficient. It can be any image format that can be displayed as a background image. For the FontAwesome icons: we are currently updating our FontAwesome library from 4.7 to 5 (more details [here](https://meta.discourse.org/t/introducing-font-awesome-5-and-svg-icons/101643)), and I will also add instructions as per below (this won’t be in master right away though):

---

<div class="post-metadata">

**Author:** ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)\
**Post date:** [2020年七月9日 12:07 UTC](https://meta.discourse.org/t/how-to-use-svg-for-group-flair/157252/3 "2020-07-09T12:07:01Z")

</div>

您可以将 `svg` 添加到“工作人员授权扩展名”（或“授权扩展名”）站点设置中，然后在群组的头像徽章图片设置中上传 SVG 文件。

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2020年八月8日 12:07 UTC](https://meta.discourse.org/t/how-to-use-svg-for-group-flair/157252/4 "2020-08-08T12:07:10Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
