oops, forgot to commit untracked
This commit is contained in:
parent
414bb9f90b
commit
2decb70344
1 changed files with 16 additions and 0 deletions
|
@ -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,
|
||||
};
|
||||
},
|
||||
};
|
Loading…
Reference in a new issue