docus 3.0.3-20250620-094703-73edf2a → 3.0.3-20250620-110739-1931668
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.
|
@@ -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
|
@@ -4,6 +4,8 @@ if (!page.value) {
|
|
|
4
4
|
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
// Reconsider it once this is implemented: https://github.com/nuxt/content/issues/3419
|
|
8
|
+
const prose = page.value.meta.prose
|
|
7
9
|
const title = page.value.seo?.title || page.value.title
|
|
8
10
|
const description = page.value.seo?.description || page.value.description
|
|
9
11
|
|
|
@@ -32,5 +34,6 @@ else {
|
|
|
32
34
|
<ContentRenderer
|
|
33
35
|
v-if="page"
|
|
34
36
|
:value="page"
|
|
37
|
+
:prose="prose || false"
|
|
35
38
|
/>
|
|
36
39
|
</template>
|
|
@@ -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
|
+
}
|