404 page with mike and versioning #7904
-
Hello all I am trying to set up a 404 page. The site is hosted in GitHub pages and whenever there is an error in the URL, the regular 404 page of GitHub appears. I added a {% extends "main.html" %}
{% block htmltitle %}
<title>404</title>
{% endblock %}
{% block content %}
Ooops! Something went wrong.
endblock %} in the I did check the Any pointers are appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
Hi @niden Have you set the
References: |
Beta Was this translation helpful? Give feedback.
-
There is no 404.html in the root of the When an invalid URL loads then the back-end server, GitHub Pages loads the MkDocs generates only static HTML pages, there is no "browser application" which would resolve the path to the proper 404 page of a given version. The root index.html file replaces the location with /latest, I don't know what generates this source 🤔 Does mike add it? Also the 404 page being a static file would still have to have some JavaScript to preserve navigation links for the currently selected version. References to similar threads to get a better picture: |
Beta Was this translation helpful? Give feedback.
There is no 404.html in the root of the
gh-pages
branch:When an invalid URL loads then the back-end server, GitHub Pages loads the
base_url/404.html
file, and since your repository doesn't include that then it loads the GitHub 404 page.MkDocs generates only static HTML pages, there is no "browser application" which would resolve the path to the proper 404 page of a given version.
The root index.html file replaces the location with /latest, I don't know what generates this source 🤔 Does mike add it?
The index.html source of https://mkdocs-material.github.io/example-versioning/ is a bit different yet the same.
There is no 404.html f…