社交分享

:discourse2: Summary Social Share allows you to easily add extra social providers to the share button on posts..
:eyeglasses: Preview Preview on Discourse Theme Creator
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-social-share
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

Features

:information_source: This component only works on public sites.
Share icons will be automatically disabled on private sites when site setting login required is active.


:exclamation: Manipulating settings related to crawler user agents could potentially interfere with the proper functioning of the component.

Settings:

Name Descriptions
social share links Comma delimited in this order: name, icon, title, link.
svg icons List of FontAwesome 5 icons used in this theme component. Use prefix fa- for solid icons, far- for regular icons and fab- for brand icons.

Some providers & Links:

English Social Media

Provider Sharing URL
Tumblr https://www.tumblr.com/widgets/share/tool?canonicalUrl=
Pinterest https://pinterest.com/pin/create/button/?url=
LinkedIn https://www.linkedin.com/shareArticle?mini=true&url=
Reddit https://www.reddit.com/submit?url=
Pocket https://getpocket.com/edit?url=
Evernote https://www.evernote.com/clip.action?url=
HackerNews https://news.ycombinator.com/submitlink?u=
Digg https://digg.com/submit?url=
Flipboard https://share.flipboard.com/bookmarklet/popout?v=2&title=
Instapaper https://www.instapaper.com/edit?url=
Diaspora https://share.diasporafoundation.org/?title={title}&url=
Viber viber://forward?text=
Mastodon https://mastodonshare.com/?url=
Threads https://www.threads.net/share?url=
Bluesky https://bsky.app/intent/compose?text=
Mix.com https://mix.com/add?url=
MeWe https://mewe.com/share?link=

International (non-english) Social Media

Provider Sharing URL
QZone (China) http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=
Weibo (China) http://service.weibo.com/share/share.php?url=
Douban (China) https://www.douban.com/recommend/?url=
RenRen (China) http://widget.renren.com/dialog/share?resourceUrl=
VK (Russia) https://vk.com/share.php?url=
OK.ru (Russia) https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=
Xing (Germany) https://www.xing.com/app/user?op=share&url=
SurfingBird (Russia) http://surfingbird.ru/share?url=

Phone/Audio-Based Social Media

Provider Sharing URL
SMS sms:{phone_number}?body=
Telegram https://telegram.me/share/url?url=
Line https://lineit.line.me/share/ui?url=
Skype https://web.skype.com/share?url=
WhatsApp https://wa.me/?text=
WhatsApp Web https://web.whatsapp.com/send?text= (read also here)

This guide is a wiki, if you have other providers, maybe specific for your country, just add them to the list.

You will find the share URL in the documentation for the developers.


:discourse2: Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.

Last edited by @dax 2025-05-09T19:43:20Z

Check documentPerform check on document:
75 个赞

Premise: I do not use, nor have I ever used Instagram but, I do not believe that Instagram have a share button at all, for sure there is a “follow” button that you can add if you want it.

Something like this should work (maybe)

instagram,instagram,follow me on instagram,https://www.instagram.com/your-instagram-username/?ref=

3 个赞

In the Component Settings:

social share links: LinkedIn, fab-linkedin, Share to LinkedIn, https://www.linkedin.com/shareArticle?mini=true&url=

svg-icons: fab-linkedin

I think I had to do force-refresh in the browser to nudge it.

4 个赞

你好!我在你的帖子中看到你添加了微信分享。我也想添加这个。你能和我分享一下链接吗?提前谢谢!

weixin://dl/moment??

它是

weixin://dl/moments

但请注意,这是一个非官方的深度链接 URL,如果微信更改/删除它,它可能会停止工作。

更多信息请访问

无论如何,如果配置正确并且有效,请将其添加到此主题第一个帖子的列表中。

感谢您的回复。但不幸的是,它不起作用。:cry: 点击分享按钮后,会调用微信,但没有进一步的反应。

我在中文互联网上搜索了“微信 URL 方案”,结果表明微信在两三年前就不再支持此类深度链接了。

1 个赞

我认为几个月前对共享对话框所做的更改可能破坏了这个 #theme-component。它似乎不起作用。

我安装了这个插件,但它没有显示在我的插件列表中。

  1. 我将插件添加到了我的 app.yml 中(- git clone https://github.com/discourse/discourse-social-share)
  2. 然后我重建了容器(cd /var/discourse, ./launcher rebuild app)

我不确定为什么插件没有显示在列表中。

这是一个主题组件。
因此,您需要遵循 Installing a theme or theme component

3 个赞

谢谢 @Moin。我会试试的。

该组件仍然有效,但仅限于公共网站。不久前,我们禁用了在网站为私有时将帖子和主题分享到社交提供商的功能。

我已相应更新了 OP。

5 个赞

非常感谢!Plugin 导致了我的论坛出现许多冲突问题。现在我知道原因了!:sweat_smile:

2 个赞

嗯,在公共网站上使用,但仍未正确显示……

1 个赞

这看起来很棒,但我们如何添加未在 Font Awesome 中找到的自定义图标呢?

哦,我可能找到了一些东西:

这个组件和内置的共享功能有什么区别?

1 个赞

内置的分享功能仅支持推特/脸书和电子邮件等有限的选项,此组件允许添加任何链接。

3 个赞

也就是说,这个模块是对内置共享功能的补充,而不是替代。

1 个赞

太棒了,非常感谢!这是一个很棒的补充,我喜欢我们能够添加的自定义功能。

我确实注意到一个问题,或者可能是我的配置有误。在突出显示要共享为引用的文本时,迷你工具栏会列出我添加的所有自定义共享图标,但它放不下。我尝试滚动和箭头移动,但它只是被截断了。这不是一个致命问题,但也许会引起开发人员的兴趣。

我查看了“share quote buttons”,但看起来我无法在那里添加或删除任何内容。

:man_shrugging:t3:

提示:

对于任何想要实现此功能但社交网络不在列表中的人。请务必阅读 Replace Discourse's default SVG icons with custom icons in a themehttps://meta.discourse.org/t/how-to-overrule-a-color-variable-for-one-theme-only/139166/7,它们将引导您完成配置 about.json 的过程,这很重要,这样您就可以添加 icons-sprite.svg 文件!

如果您想替换共享图标,这个帖子对您有帮助:Use standard share icon for share post (instead of link icon) - #9 by bquast :+1:t3:

太棒了!使用以下链接成功添加了分享到 Mastodon 的链接:

https://mastodonshare.com/?url= - 弹出窗口会询问实例,然后创建正确的帖子设置。

2 个赞

我现在喜欢一个提供分享链接的新服务 ShareOpenly https://shareopenly.org/,因为它不仅提供了分享链接到 Mastodon 的方式,还支持 Threads、Blusky 等。

我已经修改了我的 Social Share 设置,使用:

Share Openly, fab-mastodon, Share Openly, https://shareopenly.org/share/?url=

我正在寻找一个不同的图标,但它在我的社区中运行正常:

1 个赞