Share.js : Add Sharing Buttons to Your Website

One-click sharing to social networking sites such as Weibo, Qzone, QQ Friends, WeChat, Tencent Weibo, Douban, Facebook, Twitter, Linkedin, Google+, Diandian, etc., using font icons.

1, installation

1.1, using npm

shell
1
npm install social-share.js

1.2, download the project to the local and introduce it in HTML

Project link: https://cdnjs.com/libraries/social-share.js
If you do not need to use jQuery to import, you can not download jquery.share.min.js in it

2, use

Put the above files into the folder where the html file is located:
/img/iconfont.svg
/fonts/iconfont.ttf
/fonts/iconfont.woff
/css/share.min.css
/js/social-share.min.js
The following will install the corresponding path as a demonstration, pay attention to modify the corresponding content when using it.

Comment first then view it after your comment is approved. Join QQ Group to display all hidden texts.

3.1, delete some components

Tencent Weibo can no longer be accessed; DianDian.com's sharing API has expired, and it is recommended to hide it.

html
1
<div class="social-share" data-disabled="tencent,diandian"></div>

3.2, use in Typecho

Please put all files in the template root directory according to the above relative paths, and change the file path to:

PHP
1
<?php $this->options->themeUrl('./path/filename'); ?>

4. References

4.1, Share.js official documentation

http://overtrue.me/share.js/

4.2, GitHub

https://github.com/overtrue/share.js

5. Resource download

Comment first then view it after your comment is approved. Join QQ Group to display all hidden texts.

Share.js : Add Sharing Buttons to Your Website

https://blog.tsinbei.com/en/archives/80/

Author
Hsukqi Lee
Posted on

2022-01-22

Edited on

2022-07-28

Licensed under

CC BY-NC-ND 4.0

Comments

Name
Mail
Site
None yet