安装指南
本指南提供 AR Docs 的详细安装和配置步骤。
系统要求
| 依赖 | 版本要求 |
|---|---|
| Node.js | 18.0+ |
| npm | 8.0+ |
| Git | 任意版本 |
安装步骤
1. 克隆仓库
git clone https://github.com/your-repo/ardocs.git
cd ardocs2. 安装依赖
npm install3. 配置环境变量
复制环境变量模板:
cp .env.example .env编辑 .env 文件:
PUBLIC_SITE_URL=https://your-domain.com4. 启动开发服务器
npm run dev访问 http://localhost:4321 查看站点。
编辑器配置
VS Code 推荐扩展
配置文件
// .vscode/settings.json
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}提示
推荐使用 VS Code 作为编辑器,并安装 Astro 官方扩展以获得最佳开发体验。
故障排除
安装失败
# 清除缓存
rm -rf node_modules package-lock.json
npm install端口占用
# 使用其他端口
npm run dev -- --port 3000