Files
probably-rendering-one-more…/apps/waterfall-wiki/src/pages/skills/[[...path]].tsx
T
codex-bot ad398db781
waterfall-wiki CI and deployment / verify-and-deploy (push) Has been cancelled
studio CI and deployment / verify-and-deploy (push) Successful in 9m15s
Restore PROMPT branding, rename waterfall-wiki, and add system tag workflows
2026-10-27 00:35:59 +08:00

6 lines
621 B
TypeScript

import type {GetServerSideProps} from 'next';
import {getGuidance} from '@/content/skills/guidance';
import {guidanceUrl} from '@/content/page-links';
export default function Legacy(){return null;}
export const getServerSideProps:GetServerSideProps=async({params,query})=>{const parts=params?.path;if(parts===undefined)return {redirect:{destination:'/categories',permanent:false}};const path=Array.isArray(parts)?parts.join('/'):String(parts);return getGuidance(path)?{redirect:{destination:guidanceUrl(path)+(String(query.agent_mode||'').toLowerCase()==='true'?'?agent_mode=True':''),permanent:true}}:{notFound:true};};