25 lines
583 B
TypeScript
25 lines
583 B
TypeScript
|
|
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,
|
||
|
|
};
|
||
|
|
}
|