6 lines
497 B
TypeScript
6 lines
497 B
TypeScript
import type {GetServerSideProps} from 'next';
|
|
import {getGuidance,legacyDocumentPath} from '@/content/skills/guidance';
|
|
import {guidanceUrl} from '@/content/page-links';
|
|
export default function Legacy(){return null;}
|
|
export const getServerSideProps:GetServerSideProps=async({params})=>{const doc=params?.doc;const path=legacyDocumentPath(String(params?.skill),Array.isArray(doc)?doc[0]:'index');return getGuidance(path)?{redirect:{destination:guidanceUrl(path),permanent:true}}:{notFound:true};};
|