Add Redirect Feature or Error Documentation Links#134
Merged
SimonDarksideJ merged 4 commits intoMonoGame:mainfrom Jun 3, 2025
Merged
Add Redirect Feature or Error Documentation Links#134SimonDarksideJ merged 4 commits intoMonoGame:mainfrom
SimonDarksideJ merged 4 commits intoMonoGame:mainfrom
Conversation
`redirect_url` bypasses the conceptual processing since it runs an internal built in process within docfx to generate the redirect page.
SimonDarksideJ
approved these changes
Jun 3, 2025
Contributor
|
Can we use the e.g I would like to have |
Collaborator
|
Yes @dellis1972 , that folder is a docs area just like any other I believe. So any document with frontmatter should work. We can simply try it out if you wish |
Gaetz
pushed a commit
to Gaetz/docs.monogame.github.io
that referenced
this pull request
Jul 16, 2025
* Include the errors directory when building * Add example error page for redirect * Use `redirect` and not `redirect_url` `redirect_url` bypasses the conceptual processing since it runs an internal built in process within docfx to generate the redirect page. * Replace `.md` in redirect url with `.html`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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