Publish photo-to-shadow-puppet skill with shared linked documentation
PROMPT Docker CI and deployment / verify-and-deploy (push) Successful in 15m54s
PROMPT Docker CI and deployment / verify-and-deploy (push) Successful in 15m54s
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import type {GetServerSideProps} from 'next';
|
||||
import {SkillDocs} from '@/components/SkillDocs';
|
||||
import {getSkill} from '@/content/skills/catalog';
|
||||
export default SkillDocs;
|
||||
export const getServerSideProps:GetServerSideProps=async({params})=>{
|
||||
const skillId=String(params?.skill);const parts=params?.doc;
|
||||
if(parts!==undefined&&(!Array.isArray(parts)||parts.length!==1||parts[0]==='index'))return {notFound:true};
|
||||
const documentId=Array.isArray(parts)?parts[0]:'index';
|
||||
const skill=getSkill(skillId);
|
||||
return skill?.documents.some(d=>d.id===documentId)?{props:{skillId,documentId}}:{notFound:true};
|
||||
};
|
||||
Reference in New Issue
Block a user