Skip to content

Commit 8bd9d50

Browse files
fix: rendering
1 parent 97cf8c7 commit 8bd9d50

File tree

7 files changed

+13
-10522
lines changed

7 files changed

+13
-10522
lines changed

bun.lockb

458 KB
Binary file not shown.

components/DocsNavigation.vue

-1
Original file line numberDiff line numberDiff line change
@@ -179,5 +179,4 @@ const toggleMobileNav = () => {
179179
</nav>
180180
</div>
181181
</div>
182-
183182
</template>

components/FileTreeNode.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const currentPath = currentRoute.path;
1111
1212
// Utility function to determine if a directory is active
1313
const isActiveDirectory = (directoryPath: string) => currentPath.includes(directoryPath);
14+
1415
</script>
1516

1617
<template>
@@ -19,7 +20,7 @@ const isActiveDirectory = (directoryPath: string) => currentPath.includes(direct
1920
<div v-if="node.type === 'internalLink'" class="flex items-center gap-2 group">
2021
<span
2122
:class="[{ 'opacity-0 group-hover:opacity-55': currentPath !== node.path }, { 'opacity-100': currentPath === node.path }]">></span>
22-
<NuxtLink :to="node.path"
23+
<NuxtLink :to="node.path" prefetch
2324
:class="[{ 'opacity-55 group-hover:opacity-100': currentPath !== node.path }, { 'opacity-100': currentPath === node.path }]">
2425
{{ node.label }}</NuxtLink>
2526
</div>
@@ -29,7 +30,7 @@ const isActiveDirectory = (directoryPath: string) => currentPath.includes(direct
2930
<div class="flex items-center gap-2 group">
3031
<span
3132
:class="[{ 'opacity-0 rotate-0 group-hover:opacity-55': !isActiveDirectory(node.path) }, { 'opacity-100 rotate-90': isActiveDirectory(node.path) }]">></span>
32-
<NuxtLink :to="node.path"
33+
<NuxtLink :to="node.path" prefetch
3334
:class="[{ 'opacity-55 group-hover:opacity-100': currentPath !== node.path }, { 'opacity-100': currentPath === node.path }]">
3435
{{ node.label }}</NuxtLink>
3536
</div>

nuxt.config.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ export default defineNuxtConfig({
55
link: [{ rel: "icon", type: "image/png", href: "/logo.png" }],
66
},
77
},
8+
routeRules: {
9+
"/docs/**": { prerender: true },
10+
},
811
nitro: {
9-
preset: "cloudflare-pages",
12+
prerender: {
13+
crawlLinks: true,
14+
routes: ["/sitemap.xml", "/robots.txt"],
15+
},
1016
},
1117
compatibilityDate: "2024-11-01",
1218
content: {
@@ -35,11 +41,6 @@ export default defineNuxtConfig({
3541
},
3642
},
3743
},
38-
// database: {
39-
// type: "libsql",
40-
// url: process.env.TURSO_DATABASE_URL!,
41-
// authToken: process.env.TURSO_AUTH_TOKEN!,
42-
// },
4344
},
4445
devtools: { enabled: true },
4546
modules: [
@@ -48,7 +49,6 @@ export default defineNuxtConfig({
4849
"@nuxtjs/tailwindcss",
4950
"nuxt-og-image",
5051
"@nuxtjs/google-fonts",
51-
"@nuxthub/core",
5252
],
5353
site: {
5454
url: "https://authsmith.com",

package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"dependencies": {
1414
"@libsql/client": "^0.14.0",
1515
"@nuxt/content": "latest",
16-
"@nuxthub/core": "0.8.17",
1716
"@nuxtjs/google-fonts": "3.2.0",
1817
"@nuxtjs/sitemap": "7.2.3",
1918
"@nuxtjs/tailwindcss": "6.13.1",
@@ -32,6 +31,5 @@
3231
"unenv": "^1.10.0",
3332
"vue-tsc": "^2.2.0",
3433
"wrangler": "latest"
35-
},
36-
"packageManager": "pnpm@9.15.4+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0"
34+
}
3735
}

pages/docs/[...doc].vue

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
import { defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org/vue'
33
44
const route = useRoute()
5+
prerenderRoutes(route.path)
56
const path = route.path
6-
const { data } = await useAsyncData(() => queryCollection('docs').path(path).first(), {
7-
watch: [route]
8-
})
7+
const { data } = await useAsyncData(path, () => queryCollection('docs').path(path).first())
98
109
useSeoMeta({
1110
title: data.value?.title,

0 commit comments

Comments
 (0)