Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions src/components/DocsFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,37 @@ function areEqual(prevProps: DocsPageFooterProps, props: DocsPageFooterProps) {

export const DocsPageFooter = memo<DocsPageFooterProps>(
function DocsPageFooter({nextRoute, prevRoute, route}) {
if (!route || route?.heading) {
if (!route || route?.heading || !route.path || route.path === '/blog') {
return null;
}

let next;
let prev;
if (route.path.indexOf('/blog') === 0) {
next = prevRoute;
prev = nextRoute;
} else {
next = nextRoute;
prev = prevRoute;
}

return (
<>
{prevRoute?.path || nextRoute?.path ? (
{prev?.path || next?.path ? (
<>
<div className="grid grid-cols-1 gap-4 py-4 mx-auto max-w-7xl md:grid-cols-2 md:py-12">
{prevRoute?.path ? (
{prev?.path ? (
<FooterLink
type="Previous"
title={prevRoute.title}
href={prevRoute.path}
title={prev.title}
href={prev.path}
/>
) : (
<div />
)}

{nextRoute?.path ? (
<FooterLink
type="Next"
title={nextRoute.title}
href={nextRoute.path}
/>
{next?.path && next.path !== '/blog' ? (
<FooterLink type="Next" title={next.title} href={next.path} />
) : (
<div />
)}
Expand Down
13 changes: 6 additions & 7 deletions src/components/Layout/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export function Page({
cleanedPath,
routeTree
);

const title = meta.title || route?.title || '';
const version = meta.version;
const description = meta.description || route?.description || '';
Expand Down Expand Up @@ -86,13 +87,11 @@ export function Page({
<LanguagesContext value={languages}>{children}</LanguagesContext>
</TocContext>
</div>
{!isBlogIndex && (
<DocsPageFooter
route={route}
nextRoute={nextRoute}
prevRoute={prevRoute}
/>
)}
<DocsPageFooter
route={route}
nextRoute={nextRoute}
prevRoute={prevRoute}
/>
</div>
</div>
);
Expand Down