Skip to content

Commit b742947

Browse files
Fix: Correct blog post navigation order
1 parent 50d6991 commit b742947

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/components/Layout/Page.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ export function Page({
5252
cleanedPath,
5353
routeTree
5454
);
55+
const getNavigationRoutes = () => {
56+
if (section !== 'blog') return { nextRoute, prevRoute };
57+
return { nextRoute: prevRoute, prevRoute: nextRoute }; // Swap for blog
58+
};
59+
60+
const { nextRoute: finalNextRoute, prevRoute: finalPrevRoute } = getNavigationRoutes();
5561
const title = meta.title || route?.title || '';
5662
const version = meta.version;
5763
const description = meta.description || route?.description || '';
@@ -89,8 +95,8 @@ export function Page({
8995
{!isBlogIndex && (
9096
<DocsPageFooter
9197
route={route}
92-
nextRoute={nextRoute}
93-
prevRoute={prevRoute}
98+
nextRoute={finalNextRoute}
99+
prevRoute={finalPrevRoute}
94100
/>
95101
)}
96102
</div>

0 commit comments

Comments
 (0)