vite-press 食用指南
前几天给同事分享文档的时候一直在用 语雀啥的。突然想到,如果要维护一个像 vue 或者vite 那一类的文档给用户看该怎么快速搭建的。理应有前辈完成这种工作。让 grok 搜了一下。顺便解惑原来对于 wiki doc 等的认识,有兴趣的小伙伴们自己搜搜,我这里就不贴 grok 的长篇大论了 总之找到了 vite press。确实是曾经认识过它(好像是在鱼皮那里) 那么这篇博客就记录一下搭建过程(跟官方文档一致)Getting Started | VitePress 首先准备 node 环境。因为最近在开发 mcp 应用。所以心血来潮用了 bun 1 2 3 bun add -D vitepress bun vitepress init 随后会有一次互动式的初始化 显示已折叠代码(30 行) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ┌ Welcome to VitePress! │ ◇ Where should VitePress initialize the config? │ ./docs │ ◇ Where should VitePress look for your markdown files? │ ./docs │ ◇ Site title: │ My Awesome Project │ ◇ Site description: │ A VitePress Site │ ◇ Theme: │ Default Theme │ ◇ Use TypeScript for config and theme files? │ Yes │ ◇ Add VitePress npm scripts to package.json? │ Yes │ ◇ Add a prefix for VitePress npm scripts? │ Yes │ ◇ Prefix for VitePress npm scripts: │ docs │ └ Done! Now run pnpm run docs:dev and start writing. 这里对于初始化的目录结构会对后面有一定的影响。由于我是使用的./作为默认目录,也可以在已有的项目中构建 docs 目录跟项目结合在一起 ...