
Skill
sort-redirects
sort Open Publishing redirect entries
Description
Sorts redirect entries in Open Publishing redirection JSON files alphabetically by path. Use after adding redirects or when the file becomes unsorted.
SKILL.md
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
- Identify the redirection file - Determine which
.openpublishing.redirection.*.jsonfile needs sorting. - Run the sort script - Use the
sort-redirects.ps1script 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:
.\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
/).
More skills from the docs-tools repository
View all 2 skillsMore from .NET (Microsoft)
View publishermultithreaded-task-migration
migrate MSBuild tasks to multithreaded mode
msbuild
Jul 22.NETEngineeringPerformanceanalyzing-dotnet-performance
analyze .NET code for performance anti-patterns
skills
Jul 12.NETCode AnalysisDebuggingPerformanceandroid-tombstone-symbolication
symbolicate .NET runtime frames in Android tombstones
skills
Jul 12.NETAndroidDebuggingMicrosoftapple-crash-symbolication
symbolicate .NET runtime frames in crash logs
skills
Jul 12.NETDebuggingiOSmacOS +1assertion-quality
evaluate assertion quality in test suites
skills
Jul 12Code AnalysisQATestingauthor-component
create and review Blazor components
skills
Jul 15.NETBlazorC#UI Components +1