Deletes a markdown article and creates a redirect entry pointing to a different article. Use when consolidating articles, renaming or moving content, removing outdated documentation, or reorganizing the docs structure while preserving existing URLs.
Delete a markdown article from the repository and create a redirect entry that points users to a different article. This ensures existing links and bookmarks continue to work after content is reorganized.
/ for source_path_from_root)redirect_url shouldn't include the file extension or domain—just the URL pathDO NOT manually edit a redirection JSON file. Use the create-redirect-entry.ps1 script to handle the redirect creation automatically.
Remove-Itemcreate-redirect-entry.ps1 script (see below) to add the redirect entry to the appropriate JSON file. Do not manually edit the JSON file**/*.md files that reference the redirected file**/*.yml files that reference the redirected fileTo determine the correct redirection file for an article:
.openpublishing.redirection.*.json files for entries with paths similar to your source article (same folder or parent folder)Reference table:
| Product Area | Redirection File |
|---|---|
| AI | .openpublishing.redirection.ai.json |
| Architecture | .openpublishing.redirection.architecture.json |
| .NET Aspire | .openpublishing.redirection.aspire.json |
| Azure | .openpublishing.redirection.azure.json |
| .NET Core | .openpublishing.redirection.core.json |
| C# | .openpublishing.redirection.csharp.json |
| Desktop WPF | .openpublishing.redirection.desktop-wpf.json |
| .NET Framework | .openpublishing.redirection.framework.json |
| .NET Framework WinForms | .openpublishing.redirection.framework-winforms.json |
| .NET Framework WPF | .openpublishing.redirection.framework-wpf.json |
| F# | .openpublishing.redirection.fsharp.json |
| .NET Fundamentals | .openpublishing.redirection.fundamentals.json |
| Machine Learning | .openpublishing.redirection.machine-learning.json |
| Navigate | .openpublishing.redirection.navigate.json |
| Orleans | .openpublishing.redirection.orleans.json |
| .NET Standard | .openpublishing.redirection.standard.json |
| Visual Basic | .openpublishing.redirection.visual-basic.json |
| Default/General | .openpublishing.redirection.json |
ALWAYS use this script to add redirect entries. This script adds the entry in alphabetical order and handles formatting. It supports both source_path_from_root and source_path properties when reading existing entries.
Location (relative to this skill file): ./scripts/create-redirect-entry.ps1
| Parameter | Required | Description |
|---|---|---|
RedirectionFile | Yes | The redirection JSON file name (e.g., .openpublishing.redirection.csharp.json) |
SourcePath | Yes | Repository path of the deleted article (with or without leading /) |
RedirectUrl | Yes | Destination URL to redirect to |
Example:
.\scripts\create-redirect-entry.ps1 `
-RedirectionFile ".openpublishing.redirection.csharp.json" `
-SourcePath "docs/csharp/fundamentals/old-article.md" `
-RedirectUrl "/dotnet/csharp/fundamentals/new-article"
{
"source_path_from_root": "/docs/csharp/fundamentals/old-article.md",
"redirect_url": "/dotnet/csharp/fundamentals/new-article"
}
/ (preferred property)/ (some older files use this)/dotnet/)Note: The script handles both
source_path_from_rootandsource_pathwhen reading existing entries, but always writes new entries usingsource_path_from_root.