traxxx-web/pages/updates/+route.js

35 lines
588 B
JavaScript

import { resolveRoute } from 'vike/routing';
export default (pageContext) => {
{
const result = resolveRoute('/updates/@scope/@page', pageContext.urlPathname);
if (result.match) {
return result;
}
}
{
const result = resolveRoute('/updates/@scope', pageContext.urlPathname);
if (result.match) {
result.routeParams.page = '1';
return result;
}
}
{
const result = resolveRoute('/updates', pageContext.urlPathname);
if (result.match) {
result.routeParams.scope = 'latest';
result.routeParams.page = '1';
return result;
}
}
return false;
};