traxxx-web/pages/actors/@actorId/+route.js

25 lines
665 B
JavaScript
Raw Normal View History

import { match } from 'path-to-regexp';
// import { resolveRoute } from 'vike/routing'; // eslint-disable-line import/extensions
2024-10-22 01:12:42 +00:00
const path = '/actor/:actorId(\\d+)/:actorSlug?/:domain(scenes|movies)?/:scope?/:page?';
const urlMatch = match(path, { decode: decodeURIComponent });
export default (pageContext) => {
const matched = urlMatch(pageContext.urlPathname);
if (matched) {
return {
routeParams: {
actorId: matched.params.actorId,
actorSlug: matched.params.actorSlug,
domain: matched.params.domain || 'scenes',
scope: matched.params.scope || 'latest',
page: matched.params.page || '1',
path,
},
};
}
return false;
};