From a6b2e33beb9eb481e297603884fa5f0a4763084f Mon Sep 17 00:00:00 2001 From: Hyde <108911977+Hyaxon@users.noreply.github.com> Date: Wed, 14 Oct 2026 10:18:33 -0500 Subject: [PATCH] feat: added 404 page --- src/components/ui/TerminalPath.astro | 26 ++++- src/data/ascii/404.txt | 6 + src/layouts/BaseLayout.astro | 10 +- src/pages/404.astro | 158 +++++++++++++++++++++++++++ 4 files changed, 193 insertions(+), 7 deletions(-) create mode 100644 src/data/ascii/404.txt create mode 100644 src/pages/404.astro diff --git a/src/components/ui/TerminalPath.astro b/src/components/ui/TerminalPath.astro index ed7e85d..242dc55 100644 --- a/src/components/ui/TerminalPath.astro +++ b/src/components/ui/TerminalPath.astro @@ -1,15 +1,31 @@ --- +interface Props { + command?: "cat" | "ls" | "exit"; + value?: string; +} + const pathname = Astro.url.pathname; -const cleanPath = pathname.replace(/^\/|\/$/g, ""); +const cleanPath = pathname.replace(/^\/+|\/+$/g, ""); +const isDirectory = ["projects", "posts", "games"].includes(cleanPath); -const filePath = cleanPath === "" ? "home.hy" : `${cleanPath}.hy`; +const command = Astro.props.command ?? (isDirectory ? "ls" : "cat"); +const value = + Astro.props.value ?? + (isDirectory + ? `${cleanPath}/` + : cleanPath === "" + ? "home.hy" + : `${cleanPath}.hy`); --- -
+
> - cat - {filePath} + {command} + {value}