Skip to content

Commit

Permalink
fix: twitter share link
Browse files Browse the repository at this point in the history
  • Loading branch information
surmon-china committed Nov 28, 2023
1 parent d045567 commit dcda503
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/layout/share.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
}>()
const handleShare = () => {
const url = window.location.href
const title = document.title || APP_META.title
const tweetURL = `https://twitter.com/share?url=${encodeURIComponent(url)}&text=${encodeURIComponent(title)}`
const url = encodeURIComponent(window.location.href)
const title = encodeURIComponent(document.title || APP_META.title)
// https://developer.twitter.com/en/docs/twitter-for-websites/tweet-button/overview
const tweetURL = `https://twitter.com/intent/tweet?url=${url}&text=${title}`
openWindow(tweetURL, { name: `Share: ${props.repository}` })
}
</script>
Expand Down

0 comments on commit dcda503

Please sign in to comment.