Code Monkey home page Code Monkey logo

nuxt-social-share's Issues

Ability to change the label

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" 😃

Fix `useRequestUrl` returning `localhost` on production environment

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

How to correctly use the useSocialShare composable in nuxt-social-share?

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!

The link with spaces didn't work properly when shared

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.


Environment

Reproduction

<SocialShare
  v-for="network in ['facebook', 'whatsapp', 'instagram']"
  :key="network"
  :network="network"
>
  <template #icon><Icon name="mdi:${network}" /></template>
</SocialShare>

Describe the bug

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

Additional context

No response

Logs

No response

Internal server error: [unimport] failed to find "useRequestURL" imported from "#imports"

Environment

  • nuxt-social-share version: ^0.1.7
  • nuxt version: 3.4.1

Reproduction Link

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?

Describe the bug

Trying to use the component throws an error on yarn dev

Steps To Reproduce

  1. Install the package
  2. Follow the instructions (add it to nuxt.config > modules)
  3. Include
    <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

Expected behavior

The component should render as described in the documentation

Support new networks(LINE / Bluesky / Hatena Bookmark)

Thank you for your great package!!

Describe your suggestion

I would like to share to below SNS.

Use cases

I would like to support new networks.

Describe alternatives you've considered

I couldn't find any good ideas..

Additional context

Specifications and Color for each SNS are below.

  • LINE
    • https://line.me/R/share?text=[u](ref)
    • #06C755 (ref)
  • Bluesky
    • https://bsky.app/intent/compose?text=[u] (ref)
    • #1185FE
  • Hatena Bookmark
    • https://b.hatena.ne.jp/entry?url=[u] (ref)
    • #00A4DE (ref)

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.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.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
npm
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

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.