import type { NuxtPage } from 'nuxt/schema'; import type { Config } from '~/locale/config'; export default function extendPages(config: Config): (routes: NuxtPage[]) => void { return (routes: NuxtPage[]) => { if (config.nouns.enabled) { for (const subroute of config.nouns.subroutes || []) { routes.push({ path: `/${encodeURIComponent(subroute)}`, name: `nouns-${subroute}`, file: `~/data/nouns/${subroute}.vue`, }); } } }; }