docs: improve static assets documentation structure and clarifiy public folder usage#3011
docs: improve static assets documentation structure and clarifiy public folder usage#3011Timeless0911 merged 8 commits intomainfrom
Conversation
**`.md(x)` 中使用的静态资源** 部分: 1. 拆分为两个子章节: - **普通静态资源** - 描述相对路径引用(同级目录下的资源) - **public 目录** - 描述绝对路径引用(public 目录下的资源) 2. 分别为两个子章节添加了目录结构示例 3. 增加了对 Rsbuild 静态资源处理文档的引用: - 中文:`[Rsbuild 静态资源处理](https://rsbuild.rs/zh/guide/basic/static-assets)` - 英文:`[Rsbuild static assets handling](https://rsbuild.rs/guide/basic/static-assets)`
1. **将 `.md(x)` 中使用的静态资源章节移到介绍之后** - 现在是页面的第一个正式章节(在 Introduction 和 tip 之后) 2. **修改 public 目录的示例** - 删除了相对路径引用方式 ``,只保留绝对路径引用: ```mdx  ``` 3. **保持 Rsbuild 静态资源处理的引用** - 中文链接到 `https://rsbuild.rs/zh/guide/basic/static-assets`,英文链接到 `https://rsbuild.rs/guide/basic/static-assets`
1. **public 目录说明** - 增加了 "这些资源不会被构建,直接通过 URL 引用。" (英文: "These assets are not processed during the build and are referenced directly via URL.") 2. **修复 `rspress/runtime`** - 改为 `@rspress/core/runtime` 3. **Rsbuild 链接标题** - 改为 `[Rsbuild - 静态资源]` (英文: `[Rsbuild - Static Assets]`),并删除了 "相对路径和绝对路径都是支持的。" 这句话
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR reorganizes the documentation for static asset usage in .md(x) files by separating it into two distinct sections: regular static assets (relative paths) and public directory (absolute paths). It also adds a reference to Rsbuild's static assets documentation as the underlying implementation.
Changes:
- Reorganized the "Static assets used in .md(x) files" section into "Regular static assets" and "public directory" subsections
- Added reference to Rsbuild documentation for static assets handling
- Moved the section to appear earlier in the document (after the introductory tip)
- Removed outdated example showing
usage
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| website/docs/zh/guide/basic/static-assets.mdx | Restructured Chinese documentation with clearer subsections and removed incorrect public directory reference example |
| website/docs/en/guide/basic/static-assets.mdx | Restructured English documentation with clearer subsections and removed incorrect public directory reference example |
Comments suppressed due to low confidence (1)
website/docs/en/guide/basic/static-assets.mdx:155
- Inconsistent quote style: The
srcvalue uses single quotes here (line 155), while other examples in the same file use unquoted strings (e.g., line 99). For consistency, this should match the pattern used elsewhere in the document.
src: 'https://avatars.githubusercontent.com/u/56892468?s=200&v=4'
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 3 projects in monorepo, 3 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 nodePath:
📦 Download Diff Report: node Bundle Diff 📁 webPath:
📦 Download Diff Report: web Bundle Diff 📁 node_mdPath:
📦 Download Diff Report: node_md Bundle Diff Generated by Rsdoctor GitHub Action |
- 说明这些资源不会被构建,可以直接通过 URL 引用 - 开发服务器时托管在 `server.base` 根路径下的说明(带链接) - 生产构建时拷贝到 dist 目录的说明(带链接) - 常见用例示例:`robots.txt`、`manifest.json`、`favicon.ico`
Summary
docs: improve static assets documentation structure and clarifiy public folder usage
Related Issue
Checklist
AI Summary
Changes Made
This PR improves the "Static Assets" documentation for both Chinese and English versions:
Structure improvements:
Content improvements:
import image from "./demo.png"rspress/runtimeto@rspress/core/runtime./public/demo.png) for public directory - only absolute paths should be usedbasepath note for better readabilityThis PR was written using Vibe Kanban