From 08a0e80e5e5f18af3d340c51df69b16e3a58e18d Mon Sep 17 00:00:00 2001 From: Jamie Slome Date: Sun, 11 Feb 2024 16:21:50 +0000 Subject: [PATCH 1/2] chore: add nuxt-social-share as dependency and project module --- nuxt.config.ts | 2 +- package.json | 1 + pnpm-lock.yaml | 13 +++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index e729e37..761e035 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -2,7 +2,7 @@ export default defineNuxtConfig({ devtools: { enabled: true }, components: ['~/components/graphs', '~/components'], - modules: ['@unocss/nuxt', 'nuxt-og-image', 'nuxt-time', '@nuxtjs/plausible'], + modules: ['@unocss/nuxt', 'nuxt-og-image', 'nuxt-time', '@nuxtjs/plausible', '@stefanobartoletti/nuxt-social-share'], experimental: { appManifest: false, headNext: true, diff --git a/package.json b/package.json index d99588d..095c104 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@azure/identity": "^4.0.1", "@azure/storage-blob": "^12.17.0", "@nuxtjs/plausible": "^0.2.4", + "@stefanobartoletti/nuxt-social-share": "^0.5.2", "@unocss/nuxt": "^0.58.5", "nitropack": "^2.8.1", "nuxt": "^3.10.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 57502f8..10e1623 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,6 +22,9 @@ dependencies: '@nuxtjs/plausible': specifier: ^0.2.4 version: 0.2.4 + '@stefanobartoletti/nuxt-social-share': + specifier: ^0.5.2 + version: 0.5.2 '@unocss/nuxt': specifier: ^0.58.5 version: 0.58.5(postcss@8.4.33)(vite@5.0.12)(webpack@5.89.0) @@ -2419,6 +2422,16 @@ packages: resolution: {integrity: sha512-XExJS3cLqgrmNBIP3bBw6+1oQ1ksGjFh0+oClDKFYpCCqx/hlqwWO5KO/S63fzUo67SxI9dMrF0y5T/Ey7h8Zw==} dev: false + /@stefanobartoletti/nuxt-social-share@0.5.2: + resolution: {integrity: sha512-Ojg+exR9c2f54O7f1yJC973m5n2qdQdnEi4P9DsDDUu6e8ee5Gi3KHbuCF+vKfftHhQQ+ZEDqD5HheRbDDad8g==} + dependencies: + '@nuxt/kit': 3.10.1 + defu: 6.1.4 + transitivePeerDependencies: + - rollup + - supports-color + dev: false + /@tootallnate/once@2.0.0: resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} engines: {node: '>= 10'} From 87ce5a030c1a5552b38a44c5b50e29035a5c1af6 Mon Sep 17 00:00:00 2001 From: Jamie Slome Date: Sun, 11 Feb 2024 16:24:32 +0000 Subject: [PATCH 2/2] feat: add SocialShare component to ShareLinks component --- app.vue | 2 +- .../{TheShareLink.vue => ShareLinks.vue} | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) rename components/{TheShareLink.vue => ShareLinks.vue} (83%) diff --git a/app.vue b/app.vue index 88fdae5..d173154 100644 --- a/app.vue +++ b/app.vue @@ -26,7 +26,7 @@
No results could be fetched. Is it a valid domain?
-
diff --git a/components/TheShareLink.vue b/components/ShareLinks.vue similarity index 83% rename from components/TheShareLink.vue rename to components/ShareLinks.vue index ec4c06a..4a06496 100644 --- a/components/TheShareLink.vue +++ b/components/ShareLinks.vue @@ -15,7 +15,6 @@ const text = computed(() => props.domain const canonicalURL = computed(() => props.domain ? joinURL(`https://page-speed.dev`, props.domain) : 'https://page-speed.dev') const shareLink = computed(() => - 'https://twitter.com/intent/tweet?text=' + (props.domain ? encodeURIComponent([text.value, canonicalURL.value].join('\n\n')) : text.value) ) @@ -38,11 +37,18 @@ async function nativeShare () {