traxxx-web/pages/stashes/actors/+route.js

25 lines
615 B
JavaScript
Raw Permalink Normal View History

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(actors)/: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,
order: 'stashed.desc',
2024-03-14 23:08:24 +00:00
page: matched.params.page || '1',
path,
},
};
}
return false;
};