···
const posts = data.value ? data.value[0]?.children : [];
defineOgImageComponent("Page", {
24
-
description: `This is ${config.title}. Read all ${posts?.length || 0} posts published so far, but stay tuned for more!`
24
+
description: `This is ${config.title}. Read all ${posts?.length || 0} posts published so far, and stay tuned for more!`
28
+
posts?.reduce((acc, post) => {
29
+
for (const tag of post.tags as string[]) {
30
+
if (!acc.includes(tag)) {
35
+
}, [] as string[]) ?? [];
37
+
const filter = ref<string | undefined>(undefined);
39
+
const filteredPosts = computed(() => {
40
+
if (!filter.value) return posts;
41
+
return posts?.filter(
43
+
post.tags && (post.tags as string[]).includes(filter.value ?? "")
···
Change this content by editing the file <code>content/index.md</code>.
37
-
<h2 class="text-2xl font-bold my-6">
58
+
<h2 class="text-2xl font-bold my-6">
62
+
<section class="my-6">
66
+
<div class="w-full overflow-x-scroll flex flex-row items-start">
71
+
'flex px-2 py-1 mr-2 mb-2 w-max flex-row items-center gap-2',
72
+
`${tag === filter ? 'bg-gray-500 dark:bg-gray-500 text-gray-100 dark:text-gray-100' : 'bg-gray-200 dark:bg-gray-800 text-gray-800 dark:text-gray-200'}`,
73
+
'rounded-full text-sm font-medium lowercase'
75
+
@click="filter = filter === tag ? undefined : tag"
78
+
v-if="tag === filter"
79
+
name="ri:close-line"
89
+
v-if="filteredPosts"
90
+
:post="filteredPosts[0]"
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4 mt-4 mb-8">
49
-
v-for="post in posts?.slice(1)"
95
+
v-for="post in filteredPosts?.slice(1)"