安装指南
前置要求
在开始之前,请确保你已经安装了以下软件:
- Node.js 16.8 或更高版本
- npm 或 yarn 或 pnpm
安装步骤
- 创建新项目:
npx create-next-app@latest my-docs- 安装 Nextra:
npm install nextra nextra-theme-docs- 通过更新
next.config.js配置你的项目:
const withNextra = require('nextra')({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.jsx'
})
module.exports = withNextra()- 启动开发服务器:
npm run dev你的文档网站现在应该在 http://localhost:3000 运行了!