Sfoglia il codice sorgente

fix: docs ssg 404 issues (#1081)

* fix: update build publish path and command in netlify.toml

* fix: update publish path and command in netlify.toml

* fix: update publish path and command in netlify.toml

* fix: update build command and publish path in netlify.toml

* fix: update redirect path in netlify.toml to target docs directory

* fix: update redirect path in netlify.toml to handle all routes

* fix: refine error handling for missing page in [...slug].vue

* fix: remove 404 error handling for missing page in [...slug].vue

* fix: add error handling for missing page in [...slug].vue

* fix: add strict routing options in nuxt.config.ts and reorganize netlify.toml

* fix: add TypeScript error suppression for glitchStrength variable in HologramCube.vue
Alvaro Saburido 2 settimane fa
parent
commit
9e1fc89d79

+ 1 - 1
docs/app/components/examples/web-gpu/HologramCube.vue

@@ -17,7 +17,7 @@ const material = new MeshBasicNodeMaterial({
   blending: AdditiveBlending,
 })
 // Position
-const glitchStrength = varying(0)
+const glitchStrength = varying(uniform(0))
 material.vertexNode = Fn(() => {
   const glitchTime = timerGlobal().sub(positionWorld.y.mul(0.5))
   glitchStrength.assign(add(

+ 2 - 1
docs/app/pages/[...slug].vue

@@ -7,8 +7,9 @@ const route = useRoute()
 const { toc } = useAppConfig()
 
 const { data: page } = await useAsyncData(route.path, () => queryCollection('docs').path(route.path).first())
+
 if (!page.value) {
-  throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
+  throw createError({ statusCode: 404, statusMessage: 'Page not found' })
 }
 
 const { data: surround } = await useAsyncData(`${route.path}-surround`, () => {

+ 6 - 0
docs/nuxt.config.ts

@@ -34,6 +34,12 @@ export default defineNuxtConfig({
     'nuxt-llms',
   ],
 
+  router: {
+    options: {
+      strict: true,
+    },
+  },
+
   devtools: {
     enabled: true,
   },

+ 6 - 1
netlify.toml

@@ -1,7 +1,12 @@
 [build]
+command = "pnpm run build && pnpm run docs:generate"
 publish = "docs/dist"
-command = "pnpm run build && pnpm docs:generate"
 
 [build.environment]
 COREPACK_INTEGRITY_KEYS = "0"
 NODE_VERSION = "22"
+
+[[redirects]]
+from = "/*"
+to = "/200.html"
+status = 200