diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 284473215..ba881f0fc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -110,3 +110,26 @@ repos: language: system entry: bash pass_filenames: false + - id: check-markdown-filename + name: Check Markdown filenames for underscores + language: system + entry: bash + files: '\.md$' + stages: + - pre-commit + args: + - -c + - | + for file in "$@"; do + filename=$(basename "$file") + if [[ "$filename" =~ ^_ ]]; then + continue + fi + if [[ "$filename" =~ _ ]]; then + echo "Error: Markdown file contains underscore: $file" + echo "Please rename to use hyphens (-) instead of underscores (_)" + echo "Example: file_name.md -> file-name.md" + exit 1 + fi + done + - -- diff --git a/.windsurf/workflows/standardize-doc.md b/.windsurf/workflows/standardize-doc.md index 2e52728dd..964da830e 100644 --- a/.windsurf/workflows/standardize-doc.md +++ b/.windsurf/workflows/standardize-doc.md @@ -24,6 +24,7 @@ description: 标准化和验证中文文档路径、文件名及链接 - **入口文件**:每个目录应使用 `README.md`(不是 `index.md`) - **安装目录**:统一使用 `install-system`(不是 `install-os`) - **嵌套深度**:避免超过 2-3 层目录 +- **结构规范**:`download.md` 应该位于一级目录(即和产品的 README 同级)且权重应该为 99(最后一项) **检查项**: