Skip to content

Commit 05abf45

Browse files
committed
redirect rules
1 parent 3552ec6 commit 05abf45

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

nuxt.config.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1+
import fs from 'node:fs'
2+
import redirects from "./assets/redirects";
3+
14
// https://nuxt.com/docs/api/configuration/nuxt-config
25
export default defineNuxtConfig({
36
devtools: { enabled: true },
47
modules: ["@nuxtjs/google-fonts"],
58
googleFonts: {
69
families: {
7-
Comfortaa: true
10+
Comfortaa: true,
811
},
912
},
13+
hooks: {
14+
"build:done"() {
15+
const file = redirects.map((redirect) => {
16+
return `${redirect.path} /${redirect.target}/ 200`;
17+
}).join("\n");
18+
19+
fs.writeFileSync("public/_redirects",file);
20+
},
21+
}
1022
});

public/_redirects

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1-
/*/ /index.html 200
2-
/twitter https://twitter.com/CreativeCodeBLN 200
1+
/meetup /https://www.meetup.com/creativecodeberlin// 200
2+
/ccs /https://funprogramming.org/pad/p/ccs/ 200
3+
/archive /https://creativecodeberlin.github.io/Stammtisch// 200
4+
/jam /https://funprogramming.org/pad/p/ccjam/ 200
5+
/twitter /https://twitter.com/CreativeCodeBLN/ 200
6+
/chat /https://funprogramming.org/chat/ 200
7+
/discord /https://discord.gg/EnqmrU9/ 200
8+
/telegram /https://t.me/creativecodeberlin/ 200
9+
/instagram /https://www.instagram.com/creativecodebln// 200
10+
/github /https://github.com/CreativeCodeBerlin/ 200
11+
/learn /https://sableraph.notion.site/Creative-Code-resources-for-beginners-and-beyond-p5-js-edition-38fce7d30b1d41a9a626ab70440f40ca/ 200
12+
/codeofconduct /https://berlincodeofconduct.org/ 200
13+
/artwork /https://creativecode.berlin/submit// 200

0 commit comments

Comments
 (0)