Skip to main content

sort-redirects

Sorts redirect entries in Open Publishing redirection JSON files alphabetically by path. Use after adding redirects or when the file becomes unsorted.

소스 정보

저장소
dotnet/docs
최근 소스 활동
2026년 2월 20일 19:26
감지된 SKILL.md 언어
영어
스타
4,771
포크
6,072

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
sort-redirects
description
Sorts redirect entries in Open Publishing redirection JSON files alphabetically by path. Use after adding redirects or when the file becomes unsorted.
# Sort Redirects Sort redirect entries in Open Publishing redirection JSON files alphabetically by path. This ensures consistency and makes the redirect files easier to maintain. ## When to Use - After adding redirect entries to a JSON file - When the redirect file has become unsorted - After merging branches that may have caused unsorted entries ## Steps 1. **Identify the redirection file** - Determine which `.openpublishing.redirection.*.json` file needs sorting. 2. **Run the sort script** - Use the `sort-redirects.ps1` script with the file path. ## Scripts ### sort-redirects.ps1 Sorts all entries in the JSON file alphabetically by path (ignoring leading `/` for `source_path_from_root`). Handles both `source_path_from_root` and `source_path` properties. Location (relative to this skill file): `./scripts/sort-redirects.ps1` | Parameter | Required | Description | |-----------|----------|-------------| | `RedirectionFile` | Yes | The path to a redirection JSON file (e.g., `.openpublishing.redirection.csharp.json`) | **Example:** ```powershell .\scripts\sort-redirects.ps1 -RedirectionFile ".openpublishing.redirection.csharp.json" ``` ## Important Notes - The script preserves all existing redirect entries, only changing their order. - Sorting is case-sensitive and alphabetical by the normalized path (without leading `/`).
GitHub에서 보기