Skip to content

Commit 5f02efa

Browse files
committed
chore: start working on a missing page redirector
1 parent a179c35 commit 5f02efa

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

.prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"printWidth": 500
3+
}

docs/.vitepress/config.mts

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ export default defineConfig({
55
title: "RetroAchievements Docs",
66
description: "The official documentation for RetroAchievements.",
77

8+
head: [["script", { src: "/assets/missing-page-redirector.js" }]],
9+
810
// TODO delete this setting
9-
ignoreDeadLinks: true,
11+
// ignoreDeadLinks: true,
1012

1113
locales: {
1214
root: {
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
const redirects = {
2+
"/RetroAchievements-Manifesto": "/guidelines/users/retroachievements-manifesto.html",
3+
"https://docs.retroachievements.org/Users-Code-of-Conduct/": "http://localhost:5173/guidelines/users/code-of-conduct.html",
4+
"https://docs.retroachievements.org/Global-Leaderboard-and-Achievement-Hunting-Rules/": "http://localhost:5173/guidelines/users/global-leaderboard-and-achievement-hunting-rules.html",
5+
"https://docs.retroachievements.org/Developers-Code-of-Conduct/": "http://localhost:5173/guidelines/developers/code-of-conduct.html",
6+
"https://docs.retroachievements.org/Creating-Entries/": "http://localhost:5173/guidelines/developers/creating-entries.html",
7+
"https://docs.retroachievements.org/Claims-System/": "http://localhost:5173/guidelines/developers/claims-system.html",
8+
"https://docs.retroachievements.org/Handling-Tickets/": "http://localhost:5173/guidelines/developers/handling-tickets.html",
9+
"https://docs.retroachievements.org/Achievement-Set-Requirements/": "http://localhost:5173/guidelines/content/achievement-set-requirements.html",
10+
"https://docs.retroachievements.org/Unwelcome-Concepts/": "http://localhost:5173/guidelines/content/unwelcome-concepts.html",
11+
"https://docs.retroachievements.org/Progression-and-Win-Condition-Guidelines/": "http://localhost:5173/guidelines/content/progression-and-win-condition-guidelines.html",
12+
"https://docs.retroachievements.org/Badge-and-Icon-Creation/": "http://localhost:5173/guidelines/content/badge-and-icon-guidelines.html",
13+
"https://docs.retroachievements.org/Achievement-Development-Overview/": "http://localhost:5173/developer-docs/achievement-development-overview.html",
14+
"https://docs.retroachievements.org/Set-Plagiarism/": "http://localhost:5173/guidelines/content/set-plagiarism.html",
15+
"https://docs.retroachievements.org/Naming-Conventions/": "http://localhost:5173/guidelines/content/naming-conventions.html",
16+
"https://docs.retroachievements.org/Writing-Policy/": "http://localhost:5173/guidelines/content/writing-policy.html",
17+
"https://docs.retroachievements.org/Code-Notes/": "http://localhost:5173/guidelines/content/code-notes.html",
18+
"https://docs.retroachievements.org/Editing-Leaderboards/": "http://localhost:5173/guidelines/content/editing-leaderboards.html",
19+
"https://docs.retroachievements.org/Achievement-Set-Revisions/": "http://localhost:5173/guidelines/content/achievement-set-revisions.html",
20+
"https://docs.retroachievements.org/Achievements-for-ROM-hacks/": "http://localhost:5173/guidelines/content/achievements-for-rom-hacks.html",
21+
"https://docs.retroachievements.org/Subsets/": "http://localhost:5173/guidelines/content/subsets.html",
22+
"https://docs.retroachievements.org/Working-with-the-Right-ROM/": "http://localhost:5173/guidelines/content/working-with-the-right-rom.html",
23+
"https://docs.retroachievements.org/Hash-Labels/": "http://localhost:5173/guidelines/content/hash-labels.html",
24+
"https://docs.retroachievements.org/FAQ/": "http://localhost:5173/general/faq.html",
25+
"https://docs.retroachievements.org/Setup-Guide/": "http://localhost:5173/general/setup-guide.html",
26+
"https://docs.retroachievements.org/Emulator-Support-and-Issues/": "http://localhost:5173/general/emulator-support-and-issues.html",
27+
"https://docs.retroachievements.org/Ways-to-Contribute/": "http://localhost:5173/general/ways-to-contribute.html",
28+
"https://docs.retroachievements.org/RABot%2C-the-RA-Discord-Robot/": "http://localhost:5173/general/rabot.html",
29+
"https://docs.retroachievements.org/Events/": "http://localhost:5173/general/events.html",
30+
"https://docs.retroachievements.org/Overlay-Themes/": "http://localhost:5173/general/overlay-themes.html",
31+
"https://docs.retroachievements.org/Useful-Links/": "http://localhost:5173/general/useful-links.html",
32+
"https://docs.retroachievements.org/Contributing-with-the-docs/": "http://localhost:5173/general/contributing-to-the-docs.html",
33+
"https://docs.retroachievements.org/About-Us/": "http://localhost:5173/general/about-us.html",
34+
"https://docs.retroachievements.org/How-to-configure-OBS-Studio-to-see-the-popups/": "http://localhost:5173/general/tutorials/how-to-configure-obs-studio.html",
35+
"https://docs.retroachievements.org/Multi-Disc-Games-Tutorial/": "http://localhost:5173/general/tutorials/multi-disc-games.html",
36+
"https://docs.retroachievements.org/Working-with-DLC-for-the-PlayStation-Portable/": "http://localhost:5173/general/tutorials/working-with-dlc-for-the-psp.html",
37+
};
38+
39+
function handleRedirects() {
40+
const { pathname } = window.location;
41+
if (redirects[pathname]) {
42+
window.location.replace(redirects[pathname]);
43+
}
44+
}
45+
46+
handleRedirects();

0 commit comments

Comments
 (0)