@@ -3,11 +3,31 @@ const fs = require("fs");
3
3
// Import ze froges
4
4
const frogs = require ( "./static/webring/froglist.json" ) ;
5
5
6
+ function makeHtmlRedirect ( frog ) {
7
+ return `
8
+ <!DOCTYPE HTML>
9
+ <html lang="en-US">
10
+ <head>
11
+ <meta charset="UTF-8">
12
+ <meta http-equiv="refresh" content="0; url=${ frog . url } ">
13
+ <script type="text/javascript">
14
+ // JS redirect as fallback if the meta tag doesn't work
15
+ window.location.href = "${ frog . url } "
16
+ </script>
17
+ <title>Page Redirection</title>
18
+ </head>
19
+ <body>
20
+ <!-- And a link, just in case -->
21
+ If you are not redirected automatically, follow this <a href='${ frog . url } '>link</a>.
22
+ </body>
23
+ </html>` ;
24
+ }
25
+
6
26
function makeRoutes ( frog , nextFrog , prevFrog ) {
7
27
fs . mkdirSync ( `./static/webring/frogs/${ frog . name } ` , { recursive : true } ) ;
8
- fs . appendFileSync ( `./static/webring/frogs/${ frog . name } .html` , frog . url ) ;
9
- fs . appendFileSync ( `./static/webring/frogs/${ frog . name } /next.html` , nextFrog . url ) ;
10
- fs . appendFileSync ( `./static/webring/frogs/${ frog . name } /prev.html` , prevFrog . url ) ;
28
+ fs . appendFileSync ( `./static/webring/frogs/${ frog . name } .html` , makeHtmlRedirect ( frog ) ) ;
29
+ fs . appendFileSync ( `./static/webring/frogs/${ frog . name } /next.html` , makeHtmlRedirect ( nextFrog ) ) ;
30
+ fs . appendFileSync ( `./static/webring/frogs/${ frog . name } /prev.html` , makeHtmlRedirect ( prevFrog ) ) ;
11
31
}
12
32
13
33
frogs . forEach ( ( frog , i ) => {
0 commit comments