Added global search page files to repo.

This commit is contained in:
2024-02-22 05:09:24 +01:00
parent c1f1eb5b24
commit ae36a951a0
4 changed files with 68 additions and 1 deletions

20
pages/search/+route.js Normal file
View File

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