next-md-blog
Markdown-first blogging for Next.js . Keep posts as .md / .mdx on disk, load them in Server Components with getBlogPost / getAllBlogPosts, render with MarkdownContent, and ship metadata, JSON-LD, RSS, and sitemap helpers — plus an optional CLI to scaffold routes and config.
Why it’s different
- Metadata lives in frontmatter — title, date, description, tags, and authors stay in the same file as the article. There is no separate per-post meta file (no
post.jsonnext topost.md) and no generated content manifest you have to treat as a second source of truth for simple blogs. - Optional site config — one TypeScript module (
next-md-blog.config.ts) for defaults and authors, not a parallel metadata tree for every post. - App Router–native — fetch posts in RSC route handlers; no extra runtime CMS required for file-based workflows.
- Small surface area — core library + initializer; you keep control of layouts and styling.
How it fits in your Next.js app
When a reader opens a post, data flows from disk through the core helpers into your page and SEO components:
Idea: your routes stay ordinary Next.js files; the library handles reading, parsing frontmatter, markdown → React, and SEO primitives.
One source of truth per post
Many toolchains introduce extra artifacts: sidecar JSON/YAML, or a generated layer (for example a build step that emits typed documents and a cache directory). next-md-blog keeps the model flat for typical blogs: one markdown file carries both prose and metadata.
You still add one optional blog-wide config file for site URL, default author, and shared author objects — that is not a per-post meta file and stays easy to reason about.
Packages
| Package | Role |
|---|---|
@next-md-blog/core | Posts, rendering, SEO helpers, feeds |
@next-md-blog/cli | Scaffold routes, config, optional OG |
Requirements
- Next.js
^16and React^19(peers of@next-md-blog/core) - Node.js 18+
Compared to other options (short)
| next-md-blog | Typical file-pipeline tools | Headless CMS | |
|---|---|---|---|
| Post metadata | Frontmatter in the .md/.mdx file | Often config + generated docs or sidecars | Schema in the CMS |
| Build step | Optional CLI once; runtime reads files | Often required codegen / cache dir | API + preview |
| Best for | Own your markdown in-repo | Heavy typing & content graphs | Editorial workflows, non-dev authors |
See the full Comparison page for stack-by-stack notes.
Where to go next
- Getting started — install, CLI, first routes
- Configuration —
createConfigand site settings - Content & frontmatter — fields and conventions
- Internationalization — locale segments and folders
This documentation site
Published at www.next-md-blog.com . Clone the repository and run:
pnpm install
pnpm dev:docsOpen http://localhost:5101 (see docs/package.json). Production hosting: Deployment.
Live demos: demo.next-md-blog.com (single locale) · demo.i18n.next-md-blog.com (i18n).
Deploy on Vercel
Standalone starters (no monorepo clone) — see Demos and Deployment.
Single locale
i18n