Files
mintlify__docs/zh/quickstart.mdx
locadex-agent[bot] 6f3ccd994e docs(locadex): add translations (#2993)
Co-authored-by: locadex-agent[bot] <217277504+locadex-agent[bot]@users.noreply.github.com>
2026-01-30 09:41:17 -08:00

154 lines
5.8 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "快速入门"
description: "部署你的文档站点并完成首次更改。"
keywords: ["快速入门","部署","入门","第一步","教程","设置","上手"]
---
完成本指南后,你将拥有一个已上线的文档站点,可以开始对其进行自定义和更新。
<div id="before-you-begin">
## 开始之前
</div>
Mintlify 使用“文档即代码”(docs-as-code)的方法来管理你的文档。站点上的每个页面都有一个对应的文件,存储在你的文档<Tooltip tip="你的文档源代码所在的位置,用于存储所有文件及其历史记录。Web 编辑器会连接到你的文档存储库以访问和修改内容,或者你也可以在本地使用自己偏好的 IDE 编辑文件。">存储库</Tooltip>中。
当你将文档存储库连接到你的 Mintlify 部署后,你可以在本地或 Web 编辑器中编辑文档,并将任何更改同步到远程存储库。
<div id="deploy-your-documentation-site">
## 部署你的文档站点
</div>
前往 [mintlify.com/start](https://mintlify.com/start) 并完成初始设置流程。在初始设置过程中,你会连接你的 GitHub 账户,为文档创建或选择一个存储库,并安装 GitHub 应用以启用自动部署。
完成初始设置后,你的文档站点会部署完成,并可通过你的 `.mintlify.app` URL 访问。
<AccordionGroup>
<Accordion title="可选:在初始设置中跳过连接 GitHub">
如果你想在不连接自己的存储库的情况下快速开始使用,可以在初始设置过程中跳过 GitHub 连接。Mintlify 会在一个私有组织下为你创建一个私有存储库,并自动为你配置 GitHub 应用。
这样你可以立即使用 Web 编辑器,并在之后迁移到你自己的存储库。
</Accordion>
</AccordionGroup>
<div id="view-your-deployed-site">
## 查看你已部署的网站
</div>
你的文档站点现在已部署在 `https://<your-project-name>.mintlify.app`。
在 [控制台](https://dashboard.mintlify.com/) 的 **Overview** 页面中可以找到准确的 URL。
<Frame>
<img src="/images/quickstart/mintlify-domain-light.png" alt="Mintlify 控制台 Overview 页面。" className="block dark:hidden" />
<img src="/images/quickstart/mintlify-domain-dark.png" alt="Mintlify 控制台 Overview 页面。" className="hidden dark:block" />
</Frame>
<Tip>
你的网站已经可以立即访问。使用这个 URL 进行测试并与团队分享。在面向正式用户分享之前,你可能希望先添加一个[自定义域名](/zh/customize/custom-domain)。
</Tip>
<div id="make-your-first-change">
## 完成你的第一次修改
</div>
<Tabs>
<Tab title="CLI">
<Steps>
<Step title="安装 CLI">
命令行界面(CLI)需要 [Node.js](https://nodejs.org/en) v20.17.0 或更高版本。为保证稳定性,建议使用 LTS 版本。
<CodeGroup>
```bash npm
npm i -g mint
```
```bash pnpm
pnpm add -g mint
```
</CodeGroup>
完整的安装步骤和故障排查请参见 [Install the CLI](/zh/installation)。
</Step>
<Step title="克隆你的存储库">
如果你还没有在本地克隆存储库,请按照 [Clone your repository](/zh/installation#clone-your-repository) 中的说明进行操作。
</Step>
<Step title="编辑页面">
在你常用的编辑器中打开 `index.mdx`,在 frontmatter 中更新 description 字段:
```mdx
---
title: "Introduction"
description: "Your custom description here"
---
```
</Step>
<Step title="本地预览">
在你的文档目录中运行以下命令:
```bash
mint dev
```
在 `http://localhost:3000` 查看预览。
</Step>
<Step title="推送你的更改">
提交并推送你的更改以触发一次部署:
```bash
git add .
git commit -m "Update description"
git push
```
Mintlify 会自动部署你的更改。你可以在控制台的 [Overview](https://dashboard.mintlify.com/) 页面查看部署状态。
</Step>
</Steps>
</Tab>
<Tab title="网页编辑器">
<Steps>
<Step title="打开网页编辑器">
在控制台中前往 [web editor](https://dashboard.mintlify.com/editor)。
</Step>
<Step title="编辑页面">
打开 **Introduction** 页面并更新说明。
<Frame>
<img src="/images/quickstart/hello-world-light.png" alt="在网页编辑器中打开的 Introduction 页面,其中说明已编辑为 Hello world!。" className="block dark:hidden" />
<img src="/images/quickstart/hello-world-dark.png" alt="在网页编辑器中打开的 Introduction 页面,其中说明已编辑为 Hello world!。" className="hidden dark:block" />
</Frame>
</Step>
<Step title="发布">
点击网页编辑器工具栏右上角的 **Publish** 按钮。
</Step>
<Step title="查看线上效果">
在控制台的 [Overview](https://dashboard.mintlify.com/) 页面中,你可以查看站点的部署状态。部署完成后,刷新你的文档站点即可看到最新的变更。
</Step>
</Steps>
</Tab>
</Tabs>
<div id="next-steps">
## 后续步骤
</div>
<Card title="使用 Web 编辑器" icon="mouse-pointer-2" horizontal href="/zh/editor/index">
在浏览器中编辑文档,并预览页面发布后的效果。
</Card>
<Card title="探索 CLI 命令" icon="terminal" horizontal href="/zh/installation#additional-commands">
查找失效链接、检查可访问性、验证 OpenAPI 规范等。
</Card>
<Card title="添加自定义域名" icon="globe" horizontal href="/zh/customize/custom-domain">
为你的文档站点使用自定义域名。
</Card>