Skip to content

Commit

Permalink
Merge pull request #14 from hedint/feature/documentation-2024-11-30
Browse files Browse the repository at this point in the history
Feature/documentation 2024 11 30
  • Loading branch information
hedint authored Nov 30, 2024
2 parents 354b728 + 931956f commit ca9515b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Changelog


## v1.1.2

[compare changes](https://github.com/hedint/vue3-social-sharing/compare/v1.1.1...v1.1.2)

## v1.1.1

[compare changes](https://github.com/hedint/vue3-social-sharing/compare/v1.1.0...v1.1.1)

## v1.1.0

[compare changes](https://github.com/hedint/vue3-social-sharing/compare/v1.0.3...v1.1.0)

## v1.0.3

Add stackblitz demo page
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,33 @@ The `url` is the only property required for all networks.
| `twitter-user` | String | Twitter user (Twitter only). |
| `media` | String | Url to a media (Pinterest, VK, Weibo, and Wordpress). |


## Custom network

You are able to add your custom network by providing shareNetworks option to the vue plugin.

```typescript
import Vue3SocialSharingPlugin from "vue3-social-sharing";

const app = createApp(App);
app.use(Vue3SocialSharingPlugin, {
shareNetworks: {
"my-network": "https://example.com?url=@u&title=@t"
}
});
app.mount("#app");
```
Available template properties in your link:
- `@u` = url
- `@t` = title
- `@d` = description
- `@q` = quote
- `@h` = hashtags
- `@m` = media
- `@tu` = twitterUser

You can find a full example in [the demo](https://stackblitz.com/edit/vue3-social-sharing-plugin?file=src%2Fmain.js).

## More examples?

You can find more examples in the playground dir of this repo.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue3-social-sharing",
"version": "1.0.3",
"version": "1.1.2",
"description": "Vue 3 social sharing plugin",
"repository": "https://github.com/hedint/vue3-social-sharing",
"keywords": [
Expand Down
3 changes: 2 additions & 1 deletion src/plugin/vue3-social-sharing.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { Plugin } from "vue";
import ShareNetwork from "../components/ShareNetwork.vue";
import type { SocialNetworks } from "@/types/social-networks.ts";

const plugin: Plugin = {
install(app, options = {}) {
install(app, options: { shareNetworks?: SocialNetworks } = {}) {
app.provide("share-networks", options.shareNetworks || {});
app.component("share-network", ShareNetwork);
},
Expand Down

0 comments on commit ca9515b

Please sign in to comment.