-
Notifications
You must be signed in to change notification settings - Fork 40
添加自动化脚本, 当用户提交文档的时候优先把图片放到和MDX同一级 #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds automation scripts to automatically migrate images to be co-located with their referencing MDX files when users commit documentation, moving them to a same-level assets directory following a specific naming convention.
- Implements image migration automation for MDX documentation files
- Adds validation scripts to enforce image naming and location standards
- Configures pre-commit hooks to automatically run migration and validation
Reviewed Changes
Copilot reviewed 7 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/move-doc-images.mjs | Core script that migrates images from /images/ to co-located .assets/ directories and updates references |
| scripts/check-images.mjs | Validation script that checks image paths, naming conventions, and enforces co-location rules |
| package.json | Adds npm scripts for image linting and migration |
| app/docs/ai/multimodal/llava/index.mdx | Example of migrated content with updated image paths and encoding issues |
| README.md | Documents the new image management workflow and rules |
| CONTRIBUTING.md | Updates contribution guidelines with image management information |
| .husky/pre-commit | Configures pre-commit hook to run migration and validation automatically |
Comments suppressed due to low confidence (2)
app/docs/ai/multimodal/llava/index.mdx:1
- The description field contains corrupted Chinese characters. The text should be properly encoded UTF-8 Chinese characters instead of the garbled text shown.
---
app/docs/ai/multimodal/llava/index.mdx:1
- The Chinese text throughout this file appears to be corrupted with encoding issues. All Chinese characters are displaying as garbled text instead of proper UTF-8 encoded characters.
---
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Crokily
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已测试无误,可合并。
添加自动化脚本, 当用户提交文档的时候优先把图片放到和MDX同一级
移动到同一级的assets同名目录下, 具体规则:
所有文档放在
docs/目录。图片需要放在 被引用的文档的同名
assets目录下(正常情况下您不应该关心这个, 该项目有自动脚本来移动图片), 例如:docxA 引用了 imgA 图片, 那么他们的文档结构应该是
docxA.assets/imgA: