一个轻量级的静态博客生成器,用 Markdown 写作,构建出干净、快速的 HTML 站点。
平时写技术博客,想要一个简单干净的站点。不需要数据库,不需要复杂配置, Markdown 文件直接变成网页。
这个工具就是做这个事的。
写作体验
阅读体验
功能扩展
# 安装依赖
npm install
# 开发模式,实时预览
npm run dev
# 构建站点
npm run build
开发服务器在 http://localhost:3000
在 content/posts/ 下放 Markdown 文件:
---
title: 文章标题
date: 2026-03-15
tags: ["前端", "TypeScript"]
category: 技术
---
正文内容,支持 **Markdown** 语法。
```typescript
console.log('Hello World');
## 配置
`content/blog.config.yml`:
```yaml
title: "我的博客"
about:
avatar: "/images/avatar.png"
description: "热爱技术的开发者"
social:
github: "https://github.com/username"
email: "email@example.com"
comments:
provider: "giscus"
repo: "username/blog-comments"
repoId: "R_kgDOxxxxxx"
配置都是可选的,不配就不显示对应模块。
blog-generator/
├── content/
│ ├── blog.config.yml # 博客配置
│ └── posts/ # Markdown 文章
├── src/
│ ├── css/ # 样式
│ └── ts/ # TypeScript 源码
├── scripts/ # 构建脚本
└── dist/ # 构建输出
GitHub Pages
npm run build
# 将 dist/ 推送到 gh-pages 分支
Vercel / Netlify
npm run builddist修改 src/css/blog.css:
:root {
--bg-primary: #fafaf9;
--text-primary: #1c1917;
--border: #e7e5e4;
}
开发过程中使用了 Kimi 辅助代码生成和问题解决。
MIT