laid groundwork to modularise new feed page

This commit is contained in:
2026-04-07 14:58:53 +02:00
parent 2ace713455
commit 692d9d8aff
5 changed files with 224 additions and 185 deletions

25
src/routes/feed/+page.ts Normal file
View File

@@ -0,0 +1,25 @@
import { entries } from './feed';
export async function load({ params, url }) {
// Get page index
let pageIndex = Number(url.searchParams.get('p'));
if (pageIndex == null) {
pageIndex = 0;
}
let contents = [];
for (let i = 0; i < 2; i += 1) {
// Vite complains if I don't do this even though it's stupid
const path = entries[i].split("/");
const page = await import(`./${path[0]}/${path[1]}.md`);
contents.push(page.default);
}
// const content = p.default;
return {
contents,
};
}