Skip to content

Commit bc4211d

Browse files
committed
Reintroduce redirect logic for page navigation in [...slug].vue to ensure users are properly redirected when a page has a redirect property. This change enhances user experience by maintaining expected navigation behavior.
1 parent 3b67331 commit bc4211d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/app/pages/[...slug].vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ if (!page.value) {
7777
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
7878
}
7979
80-
if (page.value?.redirect) {
81-
navigateTo(page.value?.redirect)
82-
}
83-
8480
const { data: surround } = await useAsyncData(`${route.path}-surround`, () => {
8581
return queryCollectionItemSurroundings('docs', route.path, {
8682
fields: ['description']
@@ -103,6 +99,10 @@ defineOgImageComponent('Docs', {
10399
headline: headline.value
104100
})
105101
102+
if (page.value?.redirect) {
103+
navigateTo(page.value?.redirect)
104+
}
105+
106106
const links = computed(() => {
107107
const links = []
108108
if (toc?.bottom?.edit) {

0 commit comments

Comments
 (0)