Skip to content

Commit 575dadf

Browse files
committed
oops, forgot to commit untracked
1 parent 9746a97 commit 575dadf

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { ContentEntryType } from 'astro';
2+
import { fileURLToPath } from 'node:url';
3+
import { parseFrontmatter } from '../content/utils.js';
4+
5+
export const markdownContentEntryType: ContentEntryType = {
6+
extensions: ['.md'],
7+
async getEntryInfo({ fileUrl, contents }: { fileUrl: URL; contents: string }) {
8+
const parsed = parseFrontmatter(contents, fileURLToPath(fileUrl));
9+
return {
10+
data: parsed.data,
11+
body: parsed.content,
12+
slug: parsed.data.slug,
13+
rawData: parsed.matter,
14+
};
15+
},
16+
};

0 commit comments

Comments
 (0)