修改页面布局大修改

This commit is contained in:
2025-08-07 13:39:05 +08:00
parent 41e273ed07
commit 25470fc7f8
23 changed files with 1238 additions and 33 deletions

View File

@@ -2,9 +2,6 @@
import type { ContentNavigationItem } from '@nuxt/content'
import { findPageHeadline } from '#ui-pro/utils/content'
// definePageMeta({
// layout: 'docs'
// })
const route = useRoute()
const appConfig = useAppConfig()
@@ -47,9 +44,15 @@ const queryPath = computed(() => {
}
})
// 根据路径判断查询的集合
const collection = computed(() => {
return queryPath.value.startsWith('/blog') ? 'blog' : 'docs'
})
const { data: page } = await useAsyncData(
`page-${route.path}`, // 使用更具体的 key
() => queryCollection('docs').path(queryPath.value).first(),
() => queryCollection(collection.value).path(queryPath.value).first(),
{
default: () => null // 提供默认值
}