Skip to content

Commit

Permalink
feat: v4.49.4
Browse files Browse the repository at this point in the history
  • Loading branch information
surmon-china committed Oct 8, 2024
1 parent 5d9587e commit e43445e
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 94 deletions.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "surmon.me",
"version": "4.49.3",
"version": "4.49.4",
"description": "Surmon.me blog",
"author": "Surmon",
"license": "MIT",
Expand Down Expand Up @@ -45,14 +45,13 @@
"lodash-es": "^4.17.21",
"lozad": "^1.16.x",
"lru-cache": "^11.x",
"mapbox-gl": "^3.6.x",
"mapbox-gl": "^3.7.x",
"marked": "^14.1.x",
"marked-highlight": "^2.1.4",
"marked-mangle": "^1.1.9",
"marked-xhtml": "^1.0.11",
"pinia": "^2.2.2",
"pinia": "^2.2.x",
"qrcode": "^1.5.x",
"qs": "^6.13.0",
"redis": "^4.7.0",
"rss": "^1.2.2",
"serialize-javascript": "^6.0.2",
Expand Down Expand Up @@ -87,11 +86,11 @@
"eslint-config-prettier": "^9.x",
"eslint-plugin-prettier": "^5.x",
"eslint-plugin-vue": "^9.x",
"globals": "^15.9.0",
"globals": "^15.10.x",
"prettier": "^3.x",
"sass": "^1.79.x",
"tsx": "^4.19.x",
"typescript": "^5.5.x",
"typescript": "^5.6.x",
"typescript-eslint": "^8.x",
"vite": "^5.4.x"
},
Expand Down
63 changes: 30 additions & 33 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 16 additions & 12 deletions src/components/widget/share.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@
</script>

<script lang="ts" setup>
import qs from 'qs'
import { computed } from 'vue'
import { useEnhancer } from '/@/app/enhancer'
import { LanguageKey } from '/@/language'
import { GAEventCategories } from '/@/constants/gtag'
import { UNDEFINED } from '/@/constants/value'
import { renderTextToQRCodeDataURL } from '/@/transforms/qrcode'
import { getPageURL } from '/@/transforms/url'
import { stringify } from '/@/transforms/qs'
import { openPopupWindow } from '/@/utils/opener'
import { copy } from '/@/utils/clipboard'
import { META } from '/@/config/app.config'
interface ShareParams {
url: string
title: string
ogTitle: string | void
description: string
}
Expand Down Expand Up @@ -56,11 +58,11 @@
url: (params) => {
return (
`https://service.weibo.com/share/share.php?` +
qs.stringify({
stringify({
url: params.url,
source: params.url,
sourceUrl: params.url,
title: params.title,
title: params.ogTitle,
content: params.description
})
)
Expand All @@ -74,9 +76,9 @@
url: (params) => {
return (
`https://twitter.com/intent/tweet?` +
qs.stringify({
stringify({
url: params.url,
text: params.title
text: params.ogTitle
})
)
}
Expand All @@ -88,9 +90,9 @@
url: (params) => {
return (
`https://www.threads.net/intent/post?` +
qs.stringify({
stringify({
url: params.url,
text: params.title
text: params.ogTitle
})
)
}
Expand All @@ -102,8 +104,8 @@
url: (params) => {
return (
`https://www.facebook.com/share.php?` +
qs.stringify({
t: params.title,
stringify({
t: params.ogTitle,
u: encodeURI(params.url)
})
)
Expand All @@ -116,8 +118,8 @@
url: (params) => {
return (
`https://www.linkedin.com/shareArticle?` +
qs.stringify({
title: params.title,
stringify({
title: params.ogTitle,
url: params.url
})
)
Expand All @@ -131,7 +133,7 @@
return (
// https://www.douban.com/service/sharebutton
`https://www.douban.com/recommend/?` +
qs.stringify({
stringify({
url: params.url,
title: params.title
})
Expand All @@ -157,6 +159,7 @@
const getURL = () => getPageURL(route.fullPath)
const getTitle = () => document.title || META.title
const getOgTitle = () => document.querySelector('meta[property="og:title"]')?.getAttribute('content') ?? UNDEFINED
const getDescription = () => {
const pageDescription = document.getElementsByName('description')?.[0]?.getAttribute('content')
return pageDescription || _i18n.t(LanguageKey.APP_SLOGAN)!
Expand Down Expand Up @@ -190,6 +193,7 @@
const shareParams: ShareParams = {
url: getURL(),
title: getTitle(),
ogTitle: getOgTitle(),
description: getDescription()
}
Expand Down
2 changes: 1 addition & 1 deletion src/composables/head.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { UseSeoMetaInput } from '@unhead/schema'
import { Head, useHead as useUnhead, useSeoMeta as useUnheadSeoMeta } from '@unhead/vue'
import { useEnhancer } from '/@/app/enhancer'
import { getPageURL } from '/@/transforms/url'
import { META, IDENTITIES } from '/@/config/app.config'
import { META } from '/@/config/app.config'

export type { Head } from '@unhead/vue'
export { createHead } from '@unhead/vue'
Expand Down
Loading

0 comments on commit e43445e

Please sign in to comment.