@caoergou/windows-xp / index / postFromMarkdown
Function: postFromMarkdown()
> postFromMarkdown(raw, defaults?): BlogPost
Defined in: src/content/blog.ts:122
Build a BlogPost from raw Markdown with frontmatter (#254) — the natural authoring on-ramp: import.meta.glob('./posts/*.md', { as: 'raw' }) then postFromMarkdown(src, { slug }). Reads title/date/excerpt/folder/icon/ tags (and description as an excerpt alias) from the frontmatter, falling back to defaults. source keeps the original text (frontmatter included) so MarkdownViewer can render the title/date header; RSS/sitemap/mirror read the parsed fields. A slug is required (frontmatter slug: or defaults.slug).
Parameters
raw
string
defaults?
Partial<Omit<BlogPost, "source">> = {}