stefanobartoletti / nuxt-social-share Goto Github PK
View Code? Open in Web Editor NEWSimple Social Sharing for Nuxt 3
Home Page: https://stefanobartoletti.github.io/nuxt-social-share/
License: MIT License
Simple Social Sharing for Nuxt 3
Home Page: https://stefanobartoletti.github.io/nuxt-social-share/
License: MIT License
Great package!
Right now the text is always "Share", which is a problem when app is not in English. Is is possible to add parameter so the text "Share" can be modified? Might be also useful when someone wants to add nicer text like "Share on Facebook" 😃
Using useRequestUrl
composable is returning localhost
on some production environments.
According to the docs here https://nuxt.com/docs/api/composables/use-request-url it is a known behavior, caused by Nitro caching features.
Currently, this is happening regardless of the hosting platform, i.e. both the playground of this module here, hosted on GitHub Pages:
and a live website here, on Netlify:
If possible, some configuration to be placed here in the module is desirable, to avoid setting this up in every project that uses the module.
Some help and clarifications have been asked here nuxt/nuxt#27393
Hi,
I'm trying to use the useSocialShare composable from the nuxt-social-share module in my Nuxt.js project, but I'm having some trouble understanding how to properly use it. Here’s what I’ve done so far:
Installed the nuxt-social-share module and configured it in nuxt.config.js.
Tried to set up the useSocialShare composable in a component like this:
<template>
<div>
<h1>Share this post</h1>
<button @click="shareOnFacebook">Share on Facebook</button>
<button @click="shareOnTwitter">Share on Twitter</button>
</div>
</template>
<script setup>
const shareFacebook = useSocialShare({
network: 'facebook',
url: 'https://www.example.com',
title: 'My Custom Title'
})
const shareTwitter = useSocialShare({
network: 'twitter',
url: 'https://www.example.com',
title: 'My Custom Title',
user: 'twitter_user',
hashtags: 'list,of,hashtags'
})
const shareOnFacebook = () => {
shareFacebook()
}
const shareOnTwitter = () => {
shareTwitter()
}
</script>
However, I encountered an issue where shareFacebook and shareTwitter are not functions, so I'm not sure how to trigger the sharing actions.
Could you please provide an example of how to correctly use the useSocialShare composable to trigger social media shares?
Thank you!
Additional network option for instagram
Summary (generated):
Here is a brief summary of the provided text:
Environment details are listed, including operating system, Node version, Nuxt version, CLI version, and more.
A code snippet is shown, featuring the SocialShare component with a v-for loop rendering multiple networks.
The bug is described as an issue with sharing links that have spaces in them, which causes the link to be converted to normal text instead of displaying as a link.
<SocialShare
v-for="network in ['facebook', 'whatsapp', 'instagram']"
:key="network"
:network="network"
>
<template #icon><Icon name="mdi:${network}" /></template>
</SocialShare>
The issue is with sharing a link that have spaces in it like https://domain.com/Fournitures%20création%20accessoires%20cheveux
this will be converted to normal text instead of a link https://domain.com/Fournitures création accessoires cheveux
leading to the wrong page
No response
No response
https://stackblitz.com/edit/nuxt-starter-wuk7is?file=app.vue (Currently not working, because of the following error:
Failed to resolve import "@iconify/vue" from "node_modules/@stefanobartoletti/nuxt-social-share/dist/runtime/components/SocialShare.vue". Does the file exist?
Trying to use the component throws an error on yarn dev
<SocialShare network="facebook" />
<SocialShare network="twitter" />
<SocialShare network="linkdin" />
in a component
4. Run dev-script
5. See: Internal server error: [unimport] failed to find "useRequestURL" imported from "#imports"
in the terminal
The component should render as described in the documentation
Sharing to Facebook is not working, even on https://stefanobartoletti.github.io/nuxt-social-share.
Maybe they changed the URL for sharing? Didn't find anything on their docs yet.
Thank you for your great package!!
I would like to share to below SNS.
I would like to support new networks.
I couldn't find any good ideas..
Specifications and Color for each SNS are below.
https://bsky.app/intent/compose?text=[u]
(ref)#1185FE
And, I'm developing this feature a bit.
If you don't mind, can I submit a PR?
P.S.
I'm not good at English, and this is my first issue.
Forgive me if I make you feel bad by using incorrect words in English, i don't mean it at all.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@nuxt/kit
, @nuxt/schema
, nuxt
).github/workflows/ci.yml
actions/checkout v4
actions/setup-node v4
.github/workflows/gh-pages.yml
actions/checkout v4
actions/setup-node v4
actions/upload-pages-artifact v3
actions/deploy-pages v4
.github/workflows/stale.yml
actions/stale v9
package.json
@nuxt/kit ^3.11.2
defu ^6.1.4
@commitlint/cli ^19.3.0
@commitlint/config-conventional ^19.2.2
@nuxt/devtools ^1.3.3
@nuxt/module-builder ^0.7.0
@nuxt/schema ^3.11.2
@nuxt/test-utils ^3.13.1
@nuxtjs/tailwindcss ^6.12.0
@release-it/conventional-changelog ^8.0.1
@stefanobartoletti/eslint-config ^1.3.1
@types/node ^20.14.2
changelogen ^0.5.5
daisyui ^4.12.2
eslint ^9.4.0
husky ^9.0.11
nuxt ^3.11.2
release-it ^17.3.0
sass ^1.77.4
vitest ^1.6.0
pnpm 9.2.0
playground/package.json
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.