Skip to content

Commit 336ec2d

Browse files
committed
Update 404.astro
1 parent 31cbbd2 commit 336ec2d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/pages/404.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
// Don't want to use any of this? Delete everything in this file, the `assets`, `components`, and `layouts` directories, and start fresh.
44
55
var newSite = 'https://ratnathicam.wixsite.com/vanni-aid'
6+
const scriptTag = `<script>var newSite = '${newSite}'</script>`;
67
---
78
<title>VanniAid</title>
89
<meta http-equiv="refresh" content={`1; url=${newSite}`}>
9-
<script new-site={newSite}>
10-
var newSite = document.currentScript.getAttribute('new-site');
11-
10+
<body set:html={scriptTag} />
11+
<script>
1212
var path = location.pathname;
1313
if (path.startsWith('/')) path = path.slice(1)
14-
if (path.endsWith('/')) path = path.slice(0, -1)
14+
if (path.endsWith('/')) path = path.slice(0, -1);
1515

1616
var site = `${newSite}/${path}`;
1717
if (site.startsWith('/')) site = site.slice(1)

0 commit comments

Comments
 (0)