diff --git a/theme/src/client/components/AutoLink.vue b/theme/src/client/components/AutoLink.vue
index 1648a9ca..5d352ed5 100644
--- a/theme/src/client/components/AutoLink.vue
+++ b/theme/src/client/components/AutoLink.vue
@@ -1,7 +1,7 @@
@@ -32,8 +39,8 @@ function linkTo(e: Event) {
(config)
+
+ return notFound
+ ? { text: path, link: path }
+ : {
+ text: meta.title || path,
+ link: path,
+ }
+}
diff --git a/theme/src/client/composables/useResolveRouteWithRedirect.ts b/theme/src/client/composables/useResolveRouteWithRedirect.ts
deleted file mode 100644
index f51ba450..00000000
--- a/theme/src/client/composables/useResolveRouteWithRedirect.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { isFunction, isString } from 'vuepress/shared'
-import { useRouter } from 'vuepress/client'
-import type { Router } from 'vuepress/client'
-import type { NavItemWithLink } from '../../shared/index.js'
-
-/**
- * Resolve a route with redirection
- */
-export function useResolveRouteWithRedirect(...args: Parameters): ReturnType {
- const router = useRouter()
- const route = router.resolve(...args)
- const lastMatched = route.matched[route.matched.length - 1]
- if (!lastMatched?.redirect)
- return route
-
- const { redirect } = lastMatched
- const resolvedRedirect = isFunction(redirect) ? redirect(route) : redirect
- const resolvedRedirectObj = isString(resolvedRedirect)
- ? { path: resolvedRedirect }
- : resolvedRedirect
- return useResolveRouteWithRedirect({
- hash: route.hash,
- query: route.query,
- params: route.params,
- ...resolvedRedirectObj,
- })
-}
-
-/**
- * Resolve NavLink props from string
- *
- * @example
- * - Input: '/README.md'
- * - Output: { text: 'Home', link: '/' }
- */
-export function useNavLink(item: string): NavItemWithLink {
- // the route path of vue-router is url-encoded, and we expect users are using
- // non-url-encoded string in theme config, so we need to url-encode it first to
- // resolve the route correctly
- const resolved = useResolveRouteWithRedirect(encodeURI(item))
- return {
- text: (resolved.meta as any).title || item,
- link: resolved.name === '404' ? item : resolved.fullPath,
- }
-}