Skip to content

Commit 36a3dfb

Browse files
Migrate
1 parent 371b721 commit 36a3dfb

File tree

4 files changed

+277
-0
lines changed

4 files changed

+277
-0
lines changed

.github/migrate/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">+
6+
<meta http-equiv="refresh" content="0; url=REPLACE_URL" />
7+
<title>Moving To Legacy</title>
8+
</head>
9+
<body>
10+
11+
<a href="REPLACE_URL">Redirecting...</a>
12+
13+
</body>
14+
</html>

.github/migrate/index.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const fs = require("fs/promises");
2+
const path = require("path");
3+
4+
async function exist(path) {
5+
try {
6+
await fs.access(path);
7+
return true;
8+
} catch {
9+
return false;
10+
}
11+
}
12+
13+
const location = path.join(__dirname, "..", "..");
14+
const links = require("./links.json");
15+
16+
const template = await fs.readFile("./index.html", "utf8");
17+
18+
for (const link of links) {
19+
const input = path.join(location, link.input);
20+
21+
if (await exist(input)) continue;
22+
23+
await fs.mkdir(path.dirname(input), { recursive: true });
24+
25+
await fs.writeFile(input, template.replace("REPLACE_URL", link.output));
26+
}

.github/migrate/links.json

Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
[
2+
{
3+
"input": "web/gamebuddies/index.html",
4+
"output": "https://legacy.sites.my.id/gamebuddies"
5+
},
6+
{
7+
"input": "web/funkymonkey/index.html",
8+
"output": "https://legacy.sites.my.id/funkymonkey"
9+
},
10+
{
11+
"input": "web/1001/index.html",
12+
"output": "https://legacy.sites.my.id/1001"
13+
},
14+
{
15+
"input": "web/somebitches/index.html",
16+
"output": "https://legacy.sites.my.id/somebitches"
17+
},
18+
{
19+
"input": "web/prince527-2nd/index.html",
20+
"output": "https://legacy.sites.my.id/prince527-2nd"
21+
},
22+
{
23+
"input": "web/history/index.html",
24+
"output": "https://legacy.sites.my.id/history"
25+
},
26+
{
27+
"input": "web/foresterie/index.html",
28+
"output": "https://legacy.sites.my.id/foresterie"
29+
},
30+
{
31+
"input": "web/foresterie/entreprises/index.html",
32+
"output": "https://legacy.sites.my.id/foresterie/entreprises"
33+
},
34+
{
35+
"input": "web/foresterie/entreprises/lqpzgjprjjzf2x9/index.html",
36+
"output": "https://legacy.sites.my.id/foresterie/entreprises/lqpzgjprjjzf2x9"
37+
},
38+
{
39+
"input": "web/foresterie/entreprises/25tg713j7vjvxwl/index.html",
40+
"output": "https://legacy.sites.my.id/foresterie/entreprises/25tg713j7vjvxwl"
41+
},
42+
{
43+
"input": "web/foresterie/entreprises/gcbmik2598w18lo/index.html",
44+
"output": "https://legacy.sites.my.id/foresterie/entreprises/gcbmik2598w18lo"
45+
},
46+
{
47+
"input": "web/foresterie/education/index.html",
48+
"output": "https://legacy.sites.my.id/foresterie/education"
49+
},
50+
{
51+
"input": "web/foresterie/education/sco74emw8xrawpb/index.html",
52+
"output": "https://legacy.sites.my.id/foresterie/education/sco74emw8xrawpb"
53+
},
54+
{
55+
"input": "web/foresterie/education/oq513s4ty249wgf/index.html",
56+
"output": "https://legacy.sites.my.id/foresterie/education/oq513s4ty249wgf"
57+
},
58+
{
59+
"input": "web/foresterie/education/34wkq4c6t138nf0/index.html",
60+
"output": "https://legacy.sites.my.id/foresterie/education/34wkq4c6t138nf0"
61+
},
62+
{
63+
"input": "web/foresterie/education/noxojqfyqbijz68/index.html",
64+
"output": "https://legacy.sites.my.id/foresterie/education/noxojqfyqbijz68"
65+
},
66+
{
67+
"input": "web/foresterie/education/wcleor4omvikn64/index.html",
68+
"output": "https://legacy.sites.my.id/foresterie/education/wcleor4omvikn64"
69+
},
70+
{
71+
"input": "web/foresterie/education/xokqsfeyjd9yfid/index.html",
72+
"output": "https://legacy.sites.my.id/foresterie/education/xokqsfeyjd9yfid"
73+
},
74+
{
75+
"input": "web/foresterie/education/zxk22cptoiwv9ls/index.html",
76+
"output": "https://legacy.sites.my.id/foresterie/education/zxk22cptoiwv9ls"
77+
},
78+
{
79+
"input": "web/foresterie/emploi/index.html",
80+
"output": "https://legacy.sites.my.id/foresterie/emploi"
81+
},
82+
{
83+
"input": "web/foresterie/emploi/8q0aj95ho43bsqa/index.html",
84+
"output": "https://legacy.sites.my.id/foresterie/emploi/8q0aj95ho43bsqa"
85+
},
86+
{
87+
"input": "web/foresterie/emploi/1mtj5qewp6n3wld/index.html",
88+
"output": "https://legacy.sites.my.id/foresterie/emploi/1mtj5qewp6n3wld"
89+
},
90+
{
91+
"input": "web/foresterie/emploi/vwnkkm9whqzdbyb/index.html",
92+
"output": "https://legacy.sites.my.id/foresterie/emploi/vwnkkm9whqzdbyb"
93+
},
94+
{
95+
"input": "web/foresterie/emploi/u6dchho9rm0taku/index.html",
96+
"output": "https://legacy.sites.my.id/foresterie/emploi/u6dchho9rm0taku"
97+
},
98+
{
99+
"input": "web/foresterie/emploi/1ogjqpv5x0295mx/index.html",
100+
"output": "https://legacy.sites.my.id/foresterie/emploi/1ogjqpv5x0295mx"
101+
},
102+
{
103+
"input": "web/foresterie/emploi/5us8499c0808oh5/index.html",
104+
"output": "https://legacy.sites.my.id/foresterie/emploi/5us8499c0808oh5"
105+
},
106+
{
107+
"input": "web/foresterie/emploi/saxlr19q22eyuoz/index.html",
108+
"output": "https://legacy.sites.my.id/foresterie/emploi/saxlr19q22eyuoz"
109+
},
110+
{
111+
"input": "web/foresterie/emploi/q02zlpqtaz8i88p/index.html",
112+
"output": "https://legacy.sites.my.id/foresterie/emploi/q02zlpqtaz8i88p"
113+
},
114+
{
115+
"input": "web/foresterie/emploi/50kiwtf5tk2eul0/index.html",
116+
"output": "https://legacy.sites.my.id/foresterie/emploi/50kiwtf5tk2eul0"
117+
},
118+
{
119+
"input": "web/foresterie/emploi/j8spo0838w63eak/index.html",
120+
"output": "https://legacy.sites.my.id/foresterie/emploi/j8spo0838w63eak"
121+
},
122+
{
123+
"input": "web/duckdevs/index.html",
124+
"output": "https://legacy.sites.my.id/duckdevs"
125+
},
126+
{
127+
"input": "web/duckdevs/database/index.html",
128+
"output": "https://legacy.sites.my.id/duckdevs/database"
129+
},
130+
{
131+
"input": "web/duckdevs/database/docs/DuckDungeonReboot.html",
132+
"output": "https://legacy.sites.my.id/duckdevs/database/docs/DuckDungeonReboot.html"
133+
},
134+
{
135+
"input": "web/onu/index.html",
136+
"output": "https://legacy.sites.my.id/onu"
137+
},
138+
{
139+
"input": "web/avc/index.html",
140+
"output": "https://legacy.sites.my.id/avc"
141+
},
142+
{
143+
"input": "web/discord/index.html",
144+
"output": "https://legacy.sites.my.id/discord"
145+
},
146+
{
147+
"input": "web/doihaveinternet/index.html",
148+
"output": "https://legacy.sites.my.id/internet"
149+
},
150+
{
151+
"input": "web/vinylist/index.html",
152+
"output": "https://legacy.sites.my.id/vinylist"
153+
},
154+
{
155+
"input": "web/wiiplay/index.html",
156+
"output": "https://legacy.sites.my.id/wiiplay"
157+
},
158+
{
159+
"input": "web/wiiplay/articles/wiiplay-space/index.html",
160+
"output": "https://legacy.sites.my.id/wiiplay/articles/wiiplay-space"
161+
},
162+
{
163+
"input": "web/wiiplay/articles/wii-online-2022/index.html",
164+
"output": "https://legacy.sites.my.id/wiiplay/articles/wii-online-2022"
165+
},
166+
{
167+
"input": "web/gbo/index.html",
168+
"output": "https://legacy.sites.my.id/gamebuddiesonline"
169+
},
170+
{
171+
"input": "web/gbo/route/team/index.html",
172+
"output": "https://legacy.sites.my.id/gamebuddiesonline/route/team"
173+
},
174+
{
175+
"input": "web/gbo/route/404/index.html",
176+
"output": "https://legacy.sites.my.id/gamebuddiesonline/route/404"
177+
},
178+
{
179+
"input": "web/gbo/route/blog/index.html",
180+
"output": "https://legacy.sites.my.id/gamebuddiesonline/route/blog"
181+
},
182+
{
183+
"input": "web/gbo/route/servers/index.html",
184+
"output": "https://legacy.sites.my.id/gamebuddiesonline/route/servers"
185+
},
186+
{
187+
"input": "web/zakdoyourenglishhomework/index.html",
188+
"output": "https://legacy.sites.my.id/zakdoyourenglishhomework"
189+
},
190+
{
191+
"input": "web/prince527-3rd/index.html",
192+
"output": "https://legacy.sites.my.id/prince527-3rd"
193+
},
194+
{
195+
"input": "web/prince527-3rd/route/mc-clients/index.html",
196+
"output": "https://legacy.sites.my.id/prince527-3rd/route/mc-clients"
197+
},
198+
{
199+
"input": "web/prince527-3rd/route/programs/programs.html",
200+
"output": "https://legacy.sites.my.id/prince527-3rd/route/programs"
201+
},
202+
{
203+
"input": "web/reycons/index.html",
204+
"output": "https://legacy.sites.my.id/reycons"
205+
},
206+
{
207+
"input": "web/fazsmp/index.html",
208+
"output": "https://legacy.sites.my.id/fazsmp"
209+
},
210+
{
211+
"input": "web/lolibyes/index.html",
212+
"output": "https://legacy.sites.my.id/lolibyes"
213+
},
214+
{
215+
"input": "web/arpismp/index.html",
216+
"output": "https://legacy.sites.my.id/arpismp"
217+
},
218+
{
219+
"input": "web/arpismp/route/info.html",
220+
"output": "https://legacy.sites.my.id/arpismp/route/info.html"
221+
},
222+
{
223+
"input": "web/arpismp/route/farms.html",
224+
"output": "https://legacy.sites.my.id/arpismp/route/farms.html"
225+
},
226+
{
227+
"input": "web/prince527-1st/index.html",
228+
"output": "https://legacy.sites.my.id/prince527-1st"
229+
},
230+
{
231+
"input": "web/school/index.html",
232+
"output": "https://legacy.sites.my.id/school"
233+
}
234+
]

.github/workflows/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ jobs:
4444
- name: Minify
4545
run: bun run ./.github/minify.js
4646

47+
- name: Migrate
48+
run: bun run ./.github/migrate/index.js
49+
4750
- name: Cleanup Bun
4851
run: |
4952
rm -rf node_modules

0 commit comments

Comments
 (0)