Files
mintlify__docs/zh/create/files.mdx
mintlify[bot] fed930aa2d docs: translate Vale-warning fixes into es, fr, zh (#6380)
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-07-03 00:33:45 +00:00

57 lines
1.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: "从你的文档仓库提供图片、视频、PDF 和数据文件等静态资产,支持自动优化和 CDN 分发。"
keywords: ["静态资产","支持的文件类型"]
boost: 3
---
Mintlify 会自动从你的文档存储库中,在你的 domain 上的相应路径提供静态资产。例如,如果你的仓库中有 `/images/logo.png`,该图片文件可通过 `https://docs.your-project.com/images/logo.png` 访问。
你可以向用户提供任何受支持的文件类型,包括 OpenAPI 规范、图片、视频等。
文件大小必须小于 20 MB。
<Note>
对于启用了认证的文档站点,不支持文件服务。如果你的站点需要认证,静态文件无法通过其直接 URL 访问。
</Note>
<div id="supported-file-types">
## 支持的文件类型
</div>
所有方案支持的文件类型:
- **图片**:`.png`、`.jpg`、`.jpeg`、`.gif`、`.webp`、`.svg`、`.ico`
- **视频**:`.mp4`、`.webm`
- **音频**:`.mp3`、`.wav`
- **数据**:`.json`、`.yaml`
- **样式表**:`.css`
- **脚本**:`.js`
- **字体**:`.woff`、`.woff2`、`.ttf`、`.eot`
Enterprise 方案支持的文件类型:
- **文档**:`.pdf`、`.txt`
- **数据**:`.xml`、`.csv`
- **压缩包**:`.zip`
<div id="file-organization">
## 文件结构
</div>
使用文件夹来组织文件,使你的存储库更易于浏览:
```text
/your-project
|- docs.json
|- images/
|- logo.png
|- screenshots/
|- dashboard.png
|- assets/
|- whitepaper.pdf
|- demo-video.mp4
```
Mintlify 会从你的 domain 根目录提供文件,因此存储库中的结构会直接映射到 URL 结构。依据前面的示例,`assets/whitepaper.pdf` 可通过 `https://docs.your-project.com/assets/whitepaper.pdf` 访问。