Markdown Pipeline
Last verified: 2026-03-10
The blog's build pipeline converts markdown files to static HTML pages using Next.js static generation.
Processing Chain
MarkdownServicereads all.mdfiles frommarkdown/posts/gray-matterparses YAML frontmatter into metadata objectsremarkprocesses markdown through a plugin chain:remarkGfm: GitHub Flavored Markdown (tables, strikethrough, tasklists)remarkSlug: adds ID attributes to headings for anchor linksremarkToc: generates table of contents from### Table of contentsremarkMermaidToHtml: converts mermaid code blocks to renderable HTMLremarkHtml: final HTML conversion
- Dates are serialized as
YYYY-MM-DDstrings using UTC methods
Static Generation
getStaticPaths()generates routes for all posts, categories, tags, and paginated index pagesgetStaticProps()provides page-specific data (content, metadata, sidebar counts)- Catch-all route
[...route].jshandles all paths
Frontmatter Fields
| Field | Required | Description |
|---|---|---|
| title | Yes | Page title |
| slug | Auto | Generated from filename |
| category | Yes | Single category (dev, ai) |
| tags | Yes | Comma-separated |
| date | Yes | YYYY-MM-DD |
| status | Yes | published or draft |
| summary | No | One-sentence description |
| modified | No | Last modified date |
| image | No | Header image filename |
| thumbnail | No | 75x75 index thumbnail |
| imgprompt | No | AI image generation prompt |
Key File
blog/utils/MarkdownService.js: singleton service, computed once at
build time, with dev-mode file watcher for hot reload.
Related:
wiki/blog-architecture