Added easily accessible global scenes page with filters.

This commit is contained in:
2025-12-30 04:49:29 +01:00
parent 0527674333
commit f06df01e70
9 changed files with 114 additions and 14 deletions

21
pages/scenes/+route.js Normal file
View File

@@ -0,0 +1,21 @@
import { match } from 'path-to-regexp';
// import { resolveRoute } from 'vike/routing'; // eslint-disable-line import/extensions
const path = '/scenes/:scope?/:page?';
const urlMatch = match(path, { decode: decodeURIComponent });
export default (pageContext) => {
const matched = urlMatch(pageContext.urlPathname);
if (matched) {
return {
routeParams: {
scope: matched.params.scope || 'latest',
page: matched.params.page || '1',
path,
},
};
}
return false;
};