Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
455 changes: 0 additions & 455 deletions app/(home)/icons.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions app/(home)/layout.tsx

This file was deleted.

70 changes: 0 additions & 70 deletions app/(home)/page.tsx

This file was deleted.

55 changes: 55 additions & 0 deletions app/[...path]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { permanentRedirect } from 'next/navigation';
import { Metadata } from 'next';

type RedirectMap = {
[key: string]: string;
};

const staticRedirects: RedirectMap = {
'/course/subnet-architecture': '/academy/multi-chain-architecture',
'/course/teleporter': '/academy/interchain-messaging',
'/start': '/',
};

function getDestinationUrl(currentPath: string): string {
if (currentPath in staticRedirects) {
return `https://build.avax.network${staticRedirects[currentPath]}`;
}

if (currentPath.startsWith('/course/')) {
const newPath = currentPath.replace('/course/', '/academy/');
return `https://build.avax.network${newPath}`;
}

const cleanPath = currentPath.startsWith('/') ? currentPath.slice(1) : currentPath;
return `https://build.avax.network/${cleanPath}`;
}

export async function generateMetadata({
params
}: {
params: { path: string[] }
}): Promise<Metadata> {
const currentPath = `/${params.path.join('/')}`;
const destinationUrl = getDestinationUrl(currentPath);

return {
robots: {
index: false,
follow: true
},
alternates: {
canonical: destinationUrl
}
};
}

export default function CatchAllRoute({
params,
}: {
params: { path: string[] };
}) {
const currentPath = `/${params.path.join('/')}`;
const destinationUrl = getDestinationUrl(currentPath);
permanentRedirect(destinationUrl);
}
54 changes: 0 additions & 54 deletions app/api/generate-certificate/route.ts

This file was deleted.

Binary file removed app/api/og/course/[slug]/inter-bold.woff
Binary file not shown.
106 changes: 0 additions & 106 deletions app/api/og/course/[slug]/route.tsx

This file was deleted.

Binary file removed app/api/og/guide/[slug]/inter-bold.woff
Binary file not shown.
100 changes: 0 additions & 100 deletions app/api/og/guide/[slug]/route.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions app/api/search/route.ts

This file was deleted.

15 changes: 0 additions & 15 deletions app/contribute/layout.tsx

This file was deleted.

51 changes: 0 additions & 51 deletions app/contribute/page.tsx

This file was deleted.

Loading
Loading