We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9746a97 commit 575dadfCopy full SHA for 575dadf
packages/astro/src/vite-plugin-markdown/content-entry-type.ts
@@ -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