-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom 404 page with redirection for /docs/ URLs and remove unuse…
…d JavaScript
- Loading branch information
1 parent
ee395cb
commit eed0b91
Showing
3 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% extends "main.html" %} | ||
|
||
<!-- Content --> | ||
{% block content %} | ||
<h1>404 - Not found</h1> | ||
<script> | ||
// Get the current URL | ||
const path = window.location.pathname; | ||
|
||
// Check if the URL starts with "/docs/" | ||
if (path.startsWith('/docs/')) { | ||
// Redirect to "/latest/docs/" preserving the rest of the path | ||
const newPath = path.replace('/docs/', '/latest/docs/'); | ||
window.location.replace(newPath); | ||
} | ||
</script> | ||
{% endblock %} |
This file contains 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