Skip to content

Commit 50d223d

Browse files
committed
feat: add social sharing component and integrate into blog post layout
1 parent ba8d779 commit 50d223d

5 files changed

Lines changed: 40 additions & 1 deletion

File tree

app/components/SocialsShare.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script setup lang="ts">
2+
</script>
3+
4+
<template>
5+
<div class="flex flex-col items-center gap-3 mb-5">
6+
<span class="text-sm text-muted">Share this post</span>
7+
<div class="flex flex-wrap justify-center gap-4">
8+
<SocialShare
9+
v-for="network in ['bluesky', 'mastodon', 'linkedin', 'hackernews', 'reddit', 'email']"
10+
:key="network"
11+
:network="network"
12+
:styled="false"
13+
:label="false"
14+
class="text-muted p-3 rounded-lg transition-all duration-200 hover:text-primary hover:bg-elevated hover:scale-110"
15+
/>
16+
</div>
17+
</div>
18+
</template>

app/pages/posts/[slug].vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ if (post.value.image?.src) {
8787

8888
<UContentSurround :surround="surround" />
8989

90+
<SocialsShare />
91+
9092
<GiscusComments />
9193
</UPageBody>
9294

nuxt.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export default defineNuxtConfig({
88
'@vueuse/nuxt',
99
'nuxt-og-image',
1010
'@nuxt/hints',
11-
'@nuxt/scripts'
11+
'@nuxt/scripts',
12+
'@stefanobartoletti/nuxt-social-share'
1213
],
1314

1415
devtools: {
@@ -28,6 +29,10 @@ export default defineNuxtConfig({
2829
name: 'Alexandre Nédélec'
2930
},
3031

32+
socialShare: {
33+
baseUrl: 'https://techwatching.dev'
34+
},
35+
3136
experimental: {
3237
viewTransition: true
3338
},

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@iconify-json/ph": "^1.2.2",
3636
"@iconify-json/vscode-icons": "^1.2.37",
3737
"@nuxt/eslint": "^1.10.0",
38+
"@stefanobartoletti/nuxt-social-share": "^2.3.0",
3839
"eslint": "^9.39.1",
3940
"typescript": "^5.9.3",
4041
"vue-tsc": "^3.1.5"

pnpm-lock.yaml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)