mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-28 23:42:58 -04:00
18 lines
568 B
TypeScript
18 lines
568 B
TypeScript
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`,
|
|
});
|
|
}
|
|
}
|
|
};
|
|
}
|