Connect all 27 source layouts to parameterized Studio pages and shared design storage
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import type {GetStaticPaths,GetStaticProps} from 'next';
|
||||
import {LayoutWorkbench} from '../../components/LayoutWorkbench';
|
||||
import layouts from '../../content/templates/layouts.json';
|
||||
export default function LayoutPage({id}:{id:string}){return <LayoutWorkbench layoutId={id}/>}
|
||||
export const getStaticPaths:GetStaticPaths=async()=>({paths:layouts.map(l=>({params:{id:l.id}})),fallback:false});
|
||||
export const getStaticProps:GetStaticProps=async({params})=>layouts.some(l=>l.id===params?.id)?{props:{id:params?.id}}:{notFound:true};
|
||||
Reference in New Issue
Block a user