docus 3.0.3-20250617-182953-de4d23b → 3.0.3-20250620-102800-e35b7aa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/app/app/app.vue
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
const { seo } = useAppConfig()
|
|
3
3
|
const site = useSiteConfig()
|
|
4
4
|
|
|
5
|
-
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('docs')
|
|
5
|
+
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('docs'), {
|
|
6
|
+
transform: data => data.find(item => item.path === '/docs')?.children || data || [],
|
|
7
|
+
})
|
|
6
8
|
const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSections('docs'), {
|
|
7
9
|
server: false,
|
|
8
10
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { ContentNavigationItem } from '@nuxt/content'
|
|
3
3
|
import { kebabCase } from 'scule'
|
|
4
|
+
import { addPrerenderPath } from '../utils/prerender'
|
|
4
5
|
import { findPageHeadline } from '#ui-pro/utils/content'
|
|
5
6
|
|
|
6
7
|
definePageMeta({
|
|
@@ -24,6 +25,9 @@ if (!page.value) {
|
|
|
24
25
|
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
// Add the page path to the prerender list
|
|
29
|
+
addPrerenderPath(`/raw${route.path}.md`)
|
|
30
|
+
|
|
27
31
|
const title = page.value.seo?.title || page.value.title
|
|
28
32
|
const description = page.value.seo?.description || page.value.description
|
|
29
33
|
|
package/app/app/pages/index.vue
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const addPrerenderPath = (path: string) => {
|
|
2
|
+
const event = useRequestEvent()
|
|
3
|
+
if (event) {
|
|
4
|
+
event.node.res.setHeader(
|
|
5
|
+
'x-nitro-prerender',
|
|
6
|
+
[
|
|
7
|
+
event.node.res.getHeader('x-nitro-prerender'),
|
|
8
|
+
path,
|
|
9
|
+
].filter(Boolean).join(','),
|
|
10
|
+
)
|
|
11
|
+
}
|
|
12
|
+
}
|