summaryrefslogtreecommitdiff
path: root/src/pages/404.astro
blob: 2e24449b4b21f790284258b473ade9de01b2f98a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---
import TerminalBorder from "@components/TerminalBorder.astro"
import Terminal from "@layouts/Terminal.astro"

const url = new URL(Astro.request.url).pathname.substring(1);
---
<Terminal path="404">
    <TerminalBorder header="Shell" margin="0.5rem 0">
        <span>
            <p id="cd">$ cd ~/{url}</p>
            <p id="err" class="pt-3">"{url}": No such file or directory (os error 2)</p>
        </span>
    </TerminalBorder>
</Terminal>
<script>
    document.addEventListener("DOMContentLoaded", () => {
        const url = window.location.pathname.substring(1);
        document.getElementById("cd")!.textContent = `$ cd ~/${url}`;
        document.getElementById("err")!.textContent = `"${url}": No such file or directory (os error 2)`;
    });
</script>