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.md
https://docs.monogame.net/errors/setupwine
Example 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:
redirect
frontmatter for the redirect functionality.Changes Made
docfx.json
: Added/errors/**/*.md
to content build processmaster.tmpl
: Change fromredirect_url
toredirect
propertyredirect_url
is a DocFX reserved property that bypasses normal processing and skipsconceptual.extensions.js
, which we need for proper.md
to.html
link transformationsconceptual.extensions.js
: Added transformation logic formodel.redirect
.md
extensions to.html
in the redirect URLs