How can I custom share button?

AI-generated summary

The discussion addresses the need for customizable share buttons in Discourse to support social platforms beyond the default options, specifically Chinese sites like QQ, Weibo, and WeChat. longshun initiated the thread by noting the current limitations and asking how to create a plugin or customize the button for other sites. Frank and JonahAragon suggested recommending specific sites to the Discourse team or using copy/paste as a temporary workaround. jiyinyiyong confirmed the demand for Weibo buttons, citing their experience with react-china.org. codinghorror acknowledged the need for easier customization and tasked eviltrout with adding this to the 1.2 extensibility list. wuchong offered to help implement Chinese social buttons and asked for guidance on modifying source files like share_links.js. fantasticfears highlighted the technical complexity of sharing to Chinese platforms, noting requirements for specific scripts and logos, and linked to a related topic on Chinese share links. Finally, eviltrout confirmed that sharing extensibility was added in Discourse 1.2 and provided a link to the API documentation that plugins can use to implement custom sharing options.

As the image shows below:

Only these types sharing are available. What if my user want to share any other site, they have no way.

So my question is how can I custom my share button or make a plugin to make it possible to share to other site?

「いいね!」 2

Can you recommend to the Discourse team the social sites you wish to include?

Which ones do your users care about?

They could always just copy/paste that link though right? It’s not the best solution but I think that would be the easiest way, or do what @Frank said and just recommend some to the DIscourse team.

Maybe this could be tied in somehow with the SSO stuff?

Yeah, thank you for your advice.
I think I should tell the team what social sites we need.

@sam can you help us add these types of sites like QQ, Weibo. What I need to do?

It would be nice for us too if there are buttons to share posts to Weibo.
And we built http://react-china.org with Discourse.

We definitely want to make this easier to customize. @eviltrout can you add this to your list for 1.2 extensibility?

「いいね!」 1

@sam @codinghorror I can help to add some Chinese social share buttons like QQ , Weibo , WeChat.
Do I just need to modify share_links.js ? Anything else?

I’m sorry this is my first time to edit source files and I have no idea about Discourse development.

This adds support for sharing links to weibo & renren.
https://meta.discourse.org/t/chinese-share-links/23000

FYI @eviltrout Sharing links to other platforms in China is complicated. Often required to include a script hosting on their sites. And they would also provide their logo photo(font awesome may not include their service).

I forgot to close this topic, but we added Sharing extensibility in Discourse 1.2. Here is the API plugins can use:

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/lib/sharing.js.es6#L7

「いいね!」 3