Remove aboutme-related API endpoints
This commit is contained in:
parent
aa98a3fc4a
commit
6298786140
|
@ -1,21 +0,0 @@
|
|||
import { json } from '@sveltejs/kit';
|
||||
import type { Employment } from '$lib/types';
|
||||
import { getSlugFromPath, markdownToEmployment } from '$lib/utils';
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
export const GET = async ({ url }) => {
|
||||
const modules = import.meta.glob("/static/content/employments/*.md", { as: "raw" });
|
||||
let employments: Employment[] = [];
|
||||
|
||||
for (const path in modules) {
|
||||
const contents = await modules[path]() as string;
|
||||
const employment = markdownToEmployment(contents, getSlugFromPath(path));
|
||||
employments = [employment, ...employments];
|
||||
}
|
||||
|
||||
// Sort by start date
|
||||
employments.sort((e1, e2) => e2._startDate - e1._startDate);
|
||||
|
||||
return json(employments);
|
||||
}
|
|
@ -24,7 +24,6 @@ const config = {
|
|||
entries: [
|
||||
'/aboutme',
|
||||
'/donate',
|
||||
'/_api/employments.json',
|
||||
],
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue