I've been working on a simple CMS with SvelteKit. I want authenticated users to be able to create new pages or layouts within the application. I'm not sure if this would require the actual generation of +page.svelte or +layout.svelte files programmatically, or some way of dynamically loading routes from data (almost as if there was an equivalent of loading a list of components with an #each
block, but for whole pages with their own url routes). Right now I'm storing data in JSON, along with the content for each page. It also seems a bit silly to create a bunch of empty directories simply for routing and layout inheritance purposes when all my data is already stored in JSON.
Would I do this using something like Node's File System API, or is there a SvelteKit specific way to generate directories, or load file routes dynamically from data?