插件名称 | vuepress-plugin-social-share |
---|---|
发布时间 | 2020年7月4日 |
插件作者 | ntnyq |
一个易于使用但可完全配置的Vuepress社交共享插件。
# Yarn
$ yarn add vuepress-plugin-social-share
# NPM
$ npm i vuepress-plugin-social-share --save
1.在Vuepress中安装并注册插件。
module.exports = {
plugins: ['social-share'],
}
2.自定义社交共享插件。
module.exports = {
plugins: [
[
'social-share',
{
networks: ['twitter', 'facebook', 'reddit', 'telegram', 'email'],
email: 'admin@website.com',
twitterUser: 'twitter',
fallbackImage: 'social-share.png',
autoQuote: true,
isPlain: true,
noGlobalSocialShare: true
},
],
],
}
3.向插件添加更多社交网络。
const extendsNetworks = {
pinterest: {
sharer: 'https://pinterest.com/pin/create/button/?url=@url&media=@media&description=@title',
type: 'popup',
icon: '/pinterest.png',
},
...
}
module.exports = {
plugins: [
[
'social-share',
{
networks: ['twitter', 'facebook', 'reddit', 'telegram', 'email'],
email: 'admin@website.com',
twitterUser: 'twitter',
fallbackImage: 'social-share.png',
autoQuote: true,
isPlain: true,
noGlobalSocialShare: true,
extendsNetworks,
},
],
],
}