diff --git a/src/pages/404.mdx b/src/pages/404.mdx
new file mode 100644
index 0000000..0363f5f
--- /dev/null
+++ b/src/pages/404.mdx
@@ -0,0 +1,15 @@
+---
+title: Page not found
+description: The page you're looking for doesn't exist. Navigate back to Tempo documentation.
+---
+
+
+
404
+
Page not found
+
+ The page you're looking for doesn't exist or may have been moved.
+
+
+ ← Back to home
+
+
diff --git a/vocs.config.ts b/vocs.config.ts
index 6f5b8dc..1567731 100644
--- a/vocs.config.ts
+++ b/vocs.config.ts
@@ -645,4 +645,25 @@ export default defineConfig({
},
},
},
+ vite: {
+ plugins: [
+ {
+ // Vocs's default NotFound component shows a generic 404 page.
+ // This patches it to redirect to our custom /404 page instead.
+ name: 'fix-404-route',
+ transform(code, id) {
+ if (!id.includes('vocs/_lib/app/routes')) return
+ return code
+ .replace(
+ "import { NotFound } from './components/NotFound.js';",
+ "import { Navigate } from 'react-router';",
+ )
+ .replace(
+ '_jsx(NotFound, {})',
+ '_jsx(Navigate, { to: "/404", replace: true })',
+ )
+ },
+ },
+ ],
+ },
})