2024-03-14 23:08:24 +00:00
|
|
|
import { match } from 'path-to-regexp';
|
|
|
|
// import { resolveRoute } from 'vike/routing'; // eslint-disable-line import/extensions
|
|
|
|
|
2024-03-21 01:54:05 +00:00
|
|
|
const path = '/stash/:username/:stashSlug/:domain(movies)/:scope?/:page?';
|
2024-03-14 23:08:24 +00:00
|
|
|
const urlMatch = match(path, { decode: decodeURIComponent });
|
|
|
|
|
|
|
|
export default (pageContext) => {
|
|
|
|
const matched = urlMatch(pageContext.urlPathname);
|
|
|
|
|
|
|
|
if (matched) {
|
|
|
|
return {
|
|
|
|
routeParams: {
|
|
|
|
username: matched.params.username,
|
|
|
|
stashSlug: matched.params.stashSlug,
|
2024-03-21 01:54:05 +00:00
|
|
|
domain: matched.params.domain,
|
2024-03-17 02:03:36 +00:00
|
|
|
scope: matched.params.scope || 'stashed',
|
2024-03-14 23:08:24 +00:00
|
|
|
page: matched.params.page || '1',
|
|
|
|
path,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
};
|