功能
此组件仅适用于公开站点 。
当站点设置 login required(需要登录)激活时,分享图标将在私有站点上自动禁用。
操纵与 爬虫用户代理 相关的设置可能会干扰组件的正常运行。
设置:
名称
描述
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。
由我们托管? 主题组件可在我们的标准版、商业版和企业版计划中使用。
75 个赞
dax
(Daniela)
2019 年5 月 12 日 10:44
31
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 个赞
cogdog
(Alan Levine)
2020 年9 月 16 日 05:19
57
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 个赞
Kuro22
2022 年3 月 24 日 14:21
71
你好!我在你的帖子中看到你添加了微信分享。我也想添加这个。你能和我分享一下链接吗?提前谢谢!
weixin://dl/moment??
dax
(Daniela)
2022 年3 月 28 日 12:21
72
它是
weixin://dl/moments
但请注意,这是一个非官方的深度链接 URL,如果微信更改/删除它,它可能会停止工作。
更多信息请访问
mobile-website, wechat
无论如何,如果配置正确并且有效,请将其添加到此主题第一个帖子的列表中。
Kuro22
2022 年3 月 29 日 05:18
73
感谢您的回复。但不幸的是,它不起作用。 点击分享按钮后,会调用微信,但没有进一步的反应。
我在中文互联网上搜索了“微信 URL 方案”,结果表明微信在两三年前就不再支持此类深度链接了。
1 个赞
我认为几个月前对共享对话框所做的更改可能破坏了这个 #theme-component。它似乎不起作用。
Moin
2022 年6 月 24 日 21:02
76
3 个赞
dax
(Daniela)
2022 年9 月 14 日 13:25
78
Decorbuz:
它似乎不起作用。
该组件仍然有效,但仅限于公共网站。不久前,我们禁用了在网站为私有时将帖子和主题分享到社交提供商的功能。
我已相应更新了 OP。
5 个赞
Daniela:
我已经根据情况更新了 OP。
非常感谢!Plugin 导致了我的论坛出现许多冲突问题。现在我知道原因了!
2 个赞
这看起来很棒,但我们如何添加未在 Font Awesome 中找到的自定义图标呢?
哦,我可能找到了一些东西:
You can replace a Discourse’s default SVG icons individually or as a whole with your own custom SVG and override them within a theme or theme component.
Step 1 - Create an SVG Spritesheet
To get started, you must create an SVG Spritesheet. This can contain anything from a single additional custom SVG icon up to an entire replacement set of hundreds.
The spritesheet should be saved as an SVG file. In principle, you are nesting the <svg> tag contents from the original SVG icon file into <symbol> …
内置的分享功能仅支持推特/脸书和电子邮件等有限的选项,此组件允许添加任何链接。
3 个赞
volanar
(Volanar)
2023 年8 月 4 日 20:20
84
也就是说,这个模块是对内置共享功能的补充,而不是替代。
1 个赞
太棒了,非常感谢!这是一个很棒的补充,我喜欢我们能够添加的自定义功能。
我确实注意到一个问题,或者可能是我的配置有误。在突出显示要共享为引用的文本时,迷你工具栏会列出我添加的所有自定义共享图标,但它放不下。我尝试滚动和箭头移动,但它只是被截断了。这不是一个致命问题,但也许会引起开发人员的兴趣。
我查看了“share quote buttons”,但看起来我无法在那里添加或删除任何内容。
提示:
对于任何想要实现此功能但社交网络不在列表中的人。请务必阅读 Replace Discourse's default SVG icons with custom icons in a theme 和 https://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
cogdog
(Alan Levine)
2023 年10 月 31 日 17:59
86
太棒了!使用以下链接成功添加了分享到 Mastodon 的链接:
https://mastodonshare.com/?url= - 弹出窗口会询问实例,然后创建正确的帖子设置。
2 个赞
cogdog
(Alan Levine)
2024 年5 月 27 日 18:11
87
我现在喜欢一个提供分享链接的新服务 ShareOpenly https://shareopenly.org/ ,因为它不仅提供了分享链接到 Mastodon 的方式,还支持 Threads、Blusky 等。
我已经修改了我的 Social Share 设置,使用:
Share Openly, fab-mastodon, Share Openly, https://shareopenly.org/share/?url=
我正在寻找一个不同的图标,但它在我的社区中运行正常:
1 个赞