Repository navigation
Use absolute URLs in nav & media links from error templates. - #1039
Merged
Merged
Conversation
Contributor
Author
|
I haven't added any tests for this. Not sure what to include there. However, everything seems to work in manual testing. Also missing a comment in the release notes. I don't think we need anything else added to the documentation. The |
waylan
force-pushed
the
nav
branch
3 times, most recently
from
August 29, 2016 13:47
51fe79c to
4ca2fef
Compare
An error page can be served from any location and therefore it is impossable to pre-build an error page with correct relative URLs. With absolute URLs, the error pages will properly link to other pages in the nav as well as media files (css, js, images, etc) from the template regardless of the actual URL the file is served from. However, to continue to support environments where the docs root is a subdir of the server root, all other pages must continue to use relative URLs. The `site_url` is used to determine the server root when building absolute URLs for the error page to ensure those URLs continue to work in that type of environment. Relative URLs are also nessecary for those who browse the site on the local file system (via `file://`). In that case, the error page will be broken. However, as error pages are not served by a local file system, this is no more than a minor inconvience. Error pages should always be tested from a server environment. Fixes mkdocs#77.
Contributor
Author
|
I've added tests and release notes. If all the tests pass, this should be ready to go. |
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.
An error page can be served from any location and therefore it is
impossable to pre-build an error page with correct relative URLs.
With absolute URLs, the error pages will properly link to other
pages in the nav as well as media files (css, js, images, etc) from
the template regardless of the actual URL the file is served from.
However, to continue to support environments where the docs root is a subdir
of the server root, all other pages must continue to use relative URLs.
The
site_urlis used to determine the server root when buildingabsolute URLs for the error page to ensure those URLs continue to work
in that type of environment.
Relative URLs are also nessecary for those who browse the site on the
local file system (via
file://). In that case, the error page will bebroken. However, as error pages are not served by a local file system,
this is no more than a minor inconvience. Error pages should always be
tested from a server environment.
Fixes #77.