diff --git a/app.globals.json b/app.globals.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/app.globals.json @@ -0,0 +1 @@ +{} diff --git a/app/editor/[[...slug]]/page.tsx b/app/editor/[[...slug]]/page.tsx index 42224fc..cf52f3e 100644 --- a/app/editor/[[...slug]]/page.tsx +++ b/app/editor/[[...slug]]/page.tsx @@ -11,12 +11,14 @@ import { mediaAdapter } from "@/lib/adapters/media-adapter"; import { appConfig } from "@/editor.config"; import resolveRoute from "@/lib/resolve-route"; import schema from "@/app.schema.json"; +import globals from "@/app.globals.json"; export default function EditorPage() { const params = useParams(); const slug = Array.isArray(params?.slug) ? (params.slug as string[]) : []; const { key, path, params: routeParams } = resolveRoute(slug); - const data = (schema as any)[key]; + const { root, content } = (schema as any)[key] ?? {}; + const data = { root, content, globals }; const plugins = useMemo( () => [