mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-08-03 11:07:00 -04:00
14 lines
549 B
TypeScript
14 lines
549 B
TypeScript
import type { RouteMeta } from 'vue-router';
|
|
|
|
import type { Config } from '~/locale/config.ts';
|
|
|
|
export default (config: Config, variants: string[]): Record<string, { paths: string[]; meta: RouteMeta }> => {
|
|
const prefixes = [config.pronouns.prefix || '', ...config.pronouns.sentence?.prefixes || []];
|
|
return Object.fromEntries(variants.map((variant) => {
|
|
return [`pronouns-${variant}`, {
|
|
paths: prefixes.map((prefix) => `${prefix}/${encodeURIComponent(variant)}`),
|
|
meta: { variant },
|
|
}];
|
|
}));
|
|
};
|