Add Redirect Feature or Error Documentation Links #134
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a redirect system for MonoGame error documentation links. The system allows us to create stable, short URLs that can be updated without breaking external references, similar to URL shorteners.
How it works:
/errors/directory such as/errors/setupwine/index.mdhttps://docs.monogame.net/errors/setupwineExample Usage
Note
Due to DocFX's document processing limitations, the redirect URL must appear both in the front matter and as a link in the document body. By including it in the body, this ensures that link validation occurs, while maintaining the redirect functionality.
Notes
DocFX Processing Constraints: DocFX cannot validate YAML frontmatter values using its standard link validation. To work around this, we include the redirect URL twice:
redirectfrontmatter for the redirect functionality.Changes Made
docfx.json: Added/errors/**/*.mdto content build processmaster.tmpl: Change fromredirect_urltoredirectpropertyredirect_urlis a DocFX reserved property that bypasses normal processing and skipsconceptual.extensions.js, which we need for proper.mdto.htmllink transformationsconceptual.extensions.js: Added transformation logic formodel.redirect.mdextensions to.htmlin the redirect URLs