Skip to content

Commit 210b92b

Browse files
Update 404.html to replace paths that start with an uppercase letter automatically
1 parent cf9f380 commit 210b92b

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

web/resources/404.html

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1-
<h1>Page not found</h1>
1+
<div id="not-found" style="display: none;">
2+
<h1>Page not found</h1>
3+
<p>Error 404: The page you are looking for does not exist.</p>
4+
</div>
5+
<script>
6+
// Did we land on a page that doesn't exist
7+
// that starts with a uppercase letter?
8+
// Send to a path with the first letter lowercase
9+
const path = window.location.pathname;
210

3-
<p>Error 404: The page you are looking for does not exist.</p>
11+
if (path.length > 1 && /[A-Z]/.test(path[1])) {
12+
const newPath = path[0] + path[1].toLowerCase() + path.slice(2);
13+
window.location.replace(newPath);
14+
} else {
15+
document.getElementById('not-found').style.display = 'block';
16+
}
17+
</script>

web/resources/function.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ <h3>Pair: <a href="/{{ function[type_name].pair }}">{{ function[type_name].pair
8282
{% for issue in function[type_name].issues %}
8383
<li>
8484
<a target="_blank" href="https://github.com/multitheftauto/mtasa-blue/issues/{{ issue.id }}">
85-
Issue mtasa-blue #{{ issue.id }}
85+
Issue #{{ issue.id }} (mtasa-blue)
8686
</a>: {{ issue.description_html }}
8787
</li>
8888
{% endfor %}

0 commit comments

Comments
 (0)