Sorts redirect entries in Open Publishing redirection JSON files alphabetically by path. Use after adding redirects or when the file becomes unsorted.
Sort redirect entries in Open Publishing redirection JSON files alphabetically by path. This ensures consistency and makes the redirect files easier to maintain.
.openpublishing.redirection.*.json file needs sorting.sort-redirects.ps1 script with the file path.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"
/).