社交分享

:discourse2: 摘要 Social Share 允许您轻松地在帖子的分享按钮上添加额外的社交平台。
:eyeglasses: 预览 在 Discourse 主题创建器中预览
:hammer_and_wrench: 仓库链接 https://github.com/discourse/discourse-social-share
:open_book: Discourse 主题新手? Discourse 主题使用入门指南

安装此主题组件

功能

:information_source: 此组件仅适用于公开站点
当站点设置 login required(需要登录)激活时,分享图标将在私有站点上自动禁用。


:exclamation: 操纵与 爬虫用户代理 相关的设置可能会干扰组件的正常运行。

设置:

名称 描述
social share links 以逗号分隔,顺序为:名称、图标、标题、链接。
svg icons 此主题组件中使用的 FontAwesome 5 图标列表。实心图标使用前缀 fa-,常规图标使用前缀 far-,品牌图标使用前缀 fab-

部分提供商与链接:

英文社交媒体

提供商 分享 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=

国际(非英语)社交媒体

提供商 分享 URL
QZone (中国) http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=
Weibo (中国) http://service.weibo.com/share/share.php?url=
Douban (中国) https://www.douban.com/recommend/?url=
RenRen (中国) http://widget.renren.com/dialog/share?resourceUrl=
VK (俄罗斯) https://vk.com/share.php?url=
OK.ru (俄罗斯) https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=
Xing (德国) https://www.xing.com/app/user?op=share&url=
SurfingBird (俄罗斯) http://surfingbird.ru/share?url=

电话/音频类社交媒体

提供商 分享 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= (另请参阅 此处)

本指南是一个维基页面,如果您有其他提供商,也许是您国家特有的,只需将它们添加到列表中即可。

您可以在开发文档中找到分享 URL。


:discourse2: 由我们托管? 主题组件可在我们的标准版、商业版和企业版计划中使用。

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 个赞