mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
15 lines
324 B
TypeScript
15 lines
324 B
TypeScript
import { error } from '@sveltejs/kit';
|
|
|
|
export async function load() {
|
|
try {
|
|
const documentTitle = 'api';
|
|
const post = await import(`../../docs/${documentTitle}.md`);
|
|
return {
|
|
content: post.default,
|
|
meta: post.metadata
|
|
};
|
|
} catch (e) {
|
|
throw error(404, `Could not find this page`);
|
|
}
|
|
}
|