--- const path = Astro.url.pathname; const isHome = path === "/" || path === "/index.html"; function getTopic() { if (path.startsWith("/about")) { return "/about"; } const pathname = path.split("/"); if (pathname.length === 2 && pathname[1].endsWith(".html")) { return "/" + pathname[1].replace(".html", ""); } else if (pathname.length >= 3) { return "/" + pathname.slice(2, -1).join("/").replace(".html", ""); } return ""; } const topic = getTopic(); const promptText = topic ? `barrett@ruth:~$ ${topic}` : "barrett@ruth:~$"; ---
{promptText}