oops, forgot to commit untracked

This commit is contained in:
bholmesdev 2023-02-09 12:16:18 -05:00
parent 414bb9f90b
commit 2decb70344

View file

@ -0,0 +1,16 @@
import type { ContentEntryType } from 'astro';
import { fileURLToPath } from 'node:url';
import { parseFrontmatter } from '../content/utils.js';
export const markdownContentEntryType: ContentEntryType = {
extensions: ['.md'],
async getEntryInfo({ fileUrl, contents }: { fileUrl: URL; contents: string }) {
const parsed = parseFrontmatter(contents, fileURLToPath(fileUrl));
return {
data: parsed.data,
body: parsed.content,
slug: parsed.data.slug,
rawData: parsed.matter,
};
},
};