Skip to content

Commit 6b1f0c1

Browse files
committed
fix: move comopnents and fix feeds imports
1 parent 108d3fe commit 6b1f0c1

File tree

14 files changed

+70
-17
lines changed

14 files changed

+70
-17
lines changed

.vscode/mcp.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"servers": {
3+
"nuxt": {
4+
"url": "https://mcp.nuxt.com/sse",
5+
}
6+
}
7+
}

archive/components/PostsTags.vue renamed to app/components/PostsTags.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts" setup>
2-
import {getTagSlug} from "~/utils/tag";
2+
import {getTagSlug} from "~~/utils/tag";
33
44
defineProps<{ tags: string[] }>()
55
</script>
@@ -8,9 +8,9 @@ defineProps<{ tags: string[] }>()
88
<UDivider type="dashed" label="Tags"/>
99
<div class="flex flex-wrap w-full items-center gap-3 mt-5">
1010
<UBadge
11-
v-for="(tag, index) in tags"
12-
:key="index"
13-
:ui="{base: 'text-center justify-center'}">
11+
v-for="(tag, index) in tags"
12+
:key="index"
13+
:ui="{base: 'text-center justify-center'}">
1414
<NuxtLink :to="`/tags/${getTagSlug(tag)}`">{{tag}}</NuxtLink>
1515
</UBadge>
1616
</div>
File renamed without changes.
File renamed without changes.

app/pages/blog/[slug].vue

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup lang="ts">
2+
import Giscus from '@giscus/vue'
23
const route = useRoute()
34
45
const { data: post } = await useAsyncData(route.path, () => queryCollection('posts').path(route.path).first())
@@ -14,6 +15,13 @@ const { data: surround } = await useAsyncData(`${route.path}-surround`, () => {
1415
1516
const title = post.value.seo?.title || post.value.title
1617
const description = post.value.seo?.description || post.value.description
18+
if(post.value.canonical) {
19+
useHead({
20+
link: [
21+
{ rel: 'canonical', href: post.value.canonical }
22+
]
23+
})
24+
}
1725
1826
useSeoMeta({
1927
title,
@@ -31,6 +39,8 @@ if (post.value.image?.src) {
3139
headline: 'Blog'
3240
})
3341
}
42+
const colorMode = useColorMode()
43+
const theme = computed(() => colorMode.value == "dark" ? "" : "light")
3444
</script>
3545

3646
<template>
@@ -85,8 +95,31 @@ if (post.value.image?.src) {
8595
v-if="post?.body?.toc?.links?.length"
8696
#right
8797
>
88-
<UContentToc :links="post.body.toc.links" />
98+
<UContentToc :links="post.body.toc.links" />
99+
100+
<!-- <div class="">
101+
<PostsTags :tags="post.tags"/>
102+
<SocialsShare/>
103+
</div> -->
89104
</template>
90105
</UPage>
106+
<Giscus
107+
repo="techwatching/techwatching.dev"
108+
repo-id="R_kgDOGPrzmQ"
109+
category="Announcements"
110+
category-id="DIC_kwDOGPrzmc4B_fVQ"
111+
mapping="pathname"
112+
strict="0"
113+
reactions-enabled="1"
114+
emit-metadata="0"
115+
input-position="top"
116+
:theme="theme"
117+
loading="lazy"
118+
crossorigin="anonymous"/>
91119
</UContainer>
92120
</template>
121+
<style scoped>
122+
img {
123+
view-transition-name: selected-post;
124+
}
125+
</style>

app/pages/blog/index.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
const route = useRoute()
33
44
const { data: page } = await useAsyncData('blog', () => queryCollection('blog').first())
5-
const { data: posts } = await useAsyncData(route.path, () => queryCollection('posts').all())
5+
const { data: posts } = await useAsyncData(route.path, () => queryCollection('posts')
6+
.where('extension', '=', 'md')
7+
.order('date', 'DESC')
8+
.all())
69
710
const title = page.value?.seo?.title || page.value?.title
811
const description = page.value?.seo?.description || page.value?.description
@@ -15,6 +18,8 @@ useSeoMeta({
1518
})
1619
1720
defineOgImageComponent('Saas')
21+
22+
const activePost = useState()
1823
</script>
1924

2025
<template>
@@ -37,7 +42,7 @@ defineOgImageComponent('Saas')
3742
:authors="post.authors"
3843
:badge="post.badge"
3944
:orientation="index === 0 ? 'horizontal' : 'vertical'"
40-
:class="[index === 0 && 'col-span-full']"
45+
:class="[index === 0 && 'col-span-full', activePost === index && 'active']"
4146
variant="naked"
4247
:ui="{
4348
description: 'line-clamp-2'
@@ -47,3 +52,10 @@ defineOgImageComponent('Saas')
4752
</UPageBody>
4853
</UContainer>
4954
</template>
55+
56+
<style scoped>
57+
.active {
58+
view-transition-name: selected-post;
59+
contain: layout;
60+
}
61+
</style>

archive/utils/tag.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

content.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { defineCollection, z } from '@nuxt/content'
2+
import { string } from 'zod'
23

34
const variantEnum = z.enum(['solid', 'outline', 'subtle', 'soft', 'ghost', 'link'])
45
const colorEnum = z.enum(['primary', 'secondary', 'neutral', 'error', 'warning', 'success', 'info'])
@@ -130,7 +131,8 @@ export const collections = {
130131
),
131132
date: z.date(),
132133
badge: z.object({ label: z.string().nonempty() }),
133-
tags: z.array(z.string()).optional()
134+
tags: z.array(z.string()),
135+
canonical: z.string().optional(),
134136
})
135137
}),
136138
changelog: defineCollection({

nuxt.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export default defineNuxtConfig({
1111
'@stefanobartoletti/nuxt-social-share'
1212
],
1313

14+
experimental: {
15+
viewTransition: true,
16+
},
17+
1418
devtools: {
1519
enabled: true
1620
},

0 commit comments

Comments
 (0)