2024-01-25 02:07:26 +00:00
|
|
|
import { match } from 'path-to-regexp';
|
|
|
|
// import { resolveRoute } from 'vike/routing'; // eslint-disable-line import/extensions
|
|
|
|
|
2024-09-03 03:56:14 +00:00
|
|
|
const path = '/:entityType(channel|network|studio)/:entitySlug/:domain(scenes|movies|series)?/:scope?/:page?';
|
2024-01-25 02:07:26 +00:00
|
|
|
const urlMatch = match(path, { decode: decodeURIComponent });
|
|
|
|
|
|
|
|
export default (pageContext) => {
|
|
|
|
const matched = urlMatch(pageContext.urlPathname);
|
|
|
|
|
|
|
|
if (matched) {
|
|
|
|
return {
|
|
|
|
routeParams: {
|
|
|
|
entityType: matched.params.entityType,
|
|
|
|
entitySlug: matched.params.entitySlug,
|
2024-08-22 04:23:41 +00:00
|
|
|
domain: matched.params.domain || 'scenes',
|
2024-01-25 02:07:26 +00:00
|
|
|
scope: matched.params.scope || 'latest',
|
|
|
|
page: matched.params.page || '1',
|
|
|
|
path,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
};
|