fix(docs): blog links (#271)

This commit is contained in:
Neko
2025-07-15 19:18:52 +08:00
committed by GitHub
parent a878e9ceb2
commit f3da9cbb8f
+7 -3
View File
@@ -3,7 +3,7 @@ import { Icon } from '@iconify/vue'
import { chromaticPaletteFrom } from '@proj-airi/chromatic'
import { computedAsync } from '@vueuse/core'
import { subtle } from 'uncrypto'
import { useData } from 'vitepress'
import { useData, withBase } from 'vitepress'
import { computed, ref } from 'vue'
import { useI18n } from 'vue-i18n'
@@ -34,11 +34,15 @@ const categories = computed(() => {
})
const posts = computed(() => {
let postsData = props.data as Post[]
if (category.value && category.value !== 'all') {
return props.data.filter(post => post.frontmatter?.category?.toLowerCase() === category.value).filter(post => !!(post.frontmatter as any)?.title)
postsData = props.data.filter(post => post.frontmatter?.category?.toLowerCase() === category.value)
}
return (props.data as Post[]).filter(post => !!(post.frontmatter as any)?.title)
return postsData
.map(post => ({ ...post, url: withBase(post.url) }))
.filter(post => !!post.title)
})
async function stringToSeed(str: string) {