It would be great if you can import styling tools (not the same as linter) like prettier to make your code style constant. As it would be much easier for others to create pr for you.
Some changes about Api are listed here:
Merge network and extraNetwork
There is no need to provide networks and extraNetworks at same time. There could be only one option network:
Also, props on components could be updated in the same way. Meanwhile it's easy to add a legacy support.
Update on frontmatter with primary option, as well as marking other options deprecated
It's better to create a scope for social-share in frontmatter, so the new frontmatter options could be:
import { type PageFrontmatter } from "vuepress";
export interface SocialShareFrontmatter {
enable?: boolean;
global?: boolean;
// share meta
/**
* Share link
*
* @default window.location.href
*/
url?: string;
/**
* Share title
*
* @default frontmatter.title
*/
title?: string;
/**
* Share description
*
* @default frontmatter.description
*/
description?: string;
// ...
}
export interface SocialSharePluginFrontmatter extends PageFrontmatter {
"social-share"?: SocialShareFrontmatter;
/** @deprecated use `social-share.enable` instead */
noSocialShare?: boolean;
/** @deprecated use `social-share.global` instead */
noGlobalSocialShare?: boolean;
// share meta
/** @deprecated use `social-share.url` instead */
shareUrl?: string;
/** @deprecated use `social-share.url` instead */
$shareUrl?: string;
/** @deprecated use `social-share.title` instead */
shareTitle?: string;
/** @deprecated use `social-share.title` instead */
$shareTitle?: string;
// others, should be similar
}
Better style customization and provide custom option
I do think that the default style does not look well, it would be greate to provide some style customization by allowing to override share-button svg through css variables, as well as a new option custom which allows themes or users to provide styles themselves.
Merge network and extraNetwork
There is no need to provide
networks
andextraNetworks
at same time. There could be only one option network:Also, props on components could be updated in the same way. Meanwhile it's easy to add a legacy support.
Update on frontmatter with primary option, as well as marking other options deprecated
It's better to create a scope for
social-share
in frontmatter, so the new frontmatter options could be:Better style customization and provide
custom
optionI do think that the default style does not look well, it would be greate to provide some style customization by allowing to override share-button svg through css variables, as well as a new option
custom
which allows themes or users to provide styles themselves.