ntnyq / vuepress-plugin-social-share

:mega: Social sharing plugin for VuePress
https://social-share.ntnyq.com
MIT License
32 stars 6 forks source link

can't overide the defaults through "extendsNetworks" #28

Closed trolologuy closed 3 years ago

trolologuy commented 4 years ago

Hello,

Using:

Issue:

I can't override the default Networks settings. What I'm trying to achieve is to change the "sharer" links (both in the global social share as in the "social-share" element, to put my own social media links instead.

What am I doing wrong? / Is this indeed a bug in the plugin?

I'm using the following code:

/docs/README.md

# hello-world

<social-share
  :networks="[
    'facebook', 'email',
    is-plain
  ]"
/>

/docs/.vuepress/config.js :

const extendsNetworks = {
  email: {
    sharer: 'mailto:myfancymail@github.com',
    type: 'popup',
    isPlain: true,
  },
  facebook: {
    sharer: 'https://google.com',
    type: 'popup',
    isPlain: true,
  },
}

  module.exports = {
    plugins: [
      '@vuepress/plugin-nprogress',
      '@vuepress/plugin-back-to-top',
      'social-share',
        {
          networks: ['twitter', 'facebook', 'reddit', 'telegram'],
          isPlain: true,
          extendsNetworks,
        },
    ]
}

Installing and running by doing:

yarn global add vuepress 
yarn add vuepress-plugin-social-share -D
vuepress dev        
ntnyq commented 4 years ago

Email is not a built-in social-network and you need to set type: direct so it would open a sharer in current window rather than creating a new browser tab. Check Guide - extendsnetworks for detail.