Chrysoblog/src/routes/archives/+page.ts

15 lines
316 B
TypeScript

import { error } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async (_) => {
const post = await import(`$content/extra/archives.md`);
if (!post) throw error(404);
const { name } = post.metadata;
const Content = post.default;
return {
name,
Content,
};
}