From 5d5fb9364771d58ce14bc7b46bef5779fffe73eb Mon Sep 17 00:00:00 2001 From: badbl0cks <4161747+badbl0cks@users.noreply.github.com> Date: Mon, 20 Jul 2026 12:10:04 -0700 Subject: [PATCH] Replace plain page headings with a terminal-style, PageHeader component --- src/components/PageHeader.astro | 64 +++++++++++++++++++++++++++++++++ src/pages/contact.astro | 3 +- src/pages/license.astro | 13 ++++--- src/pages/tools.astro | 3 +- 4 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 src/components/PageHeader.astro diff --git a/src/components/PageHeader.astro b/src/components/PageHeader.astro new file mode 100644 index 0000000..71000de --- /dev/null +++ b/src/components/PageHeader.astro @@ -0,0 +1,64 @@ +--- +interface Props { + /** Shell-style path shown as the heading, e.g. "~/projects" */ + path: string; + /** Command echoed under the heading, without the "$ " prompt */ + command?: string; + /** Heading level; pages with their own

elsewhere should stay at 2 */ + level?: 1 | 2; +} +const { path, command, level = 2 } = Astro.props; +const Heading = level === 1 ? "h1" : "h2"; +--- + + + + diff --git a/src/pages/contact.astro b/src/pages/contact.astro index 613af44..cc0e80b 100644 --- a/src/pages/contact.astro +++ b/src/pages/contact.astro @@ -1,5 +1,6 @@ --- import Layout from "@layouts/BaseLayout.astro"; +import PageHeader from "@components/PageHeader.astro"; import { actions, isInputError } from "astro:actions"; export const prerender = false; @@ -147,7 +148,7 @@ const msgValue = pickValue("msg") || (await Astro.session?.get("msg")); -

Contact

+ { (nextAction != "complete" && (
diff --git a/src/pages/license.astro b/src/pages/license.astro index de58600..36e754f 100644 --- a/src/pages/license.astro +++ b/src/pages/license.astro @@ -1,5 +1,6 @@ --- import Layout from "@layouts/BaseLayout.astro"; +import PageHeader from "@components/PageHeader.astro"; import fs from "node:fs"; const txtToHtml = (string: string) => { @@ -23,13 +24,11 @@ const license_file_contents = txtToHtml( LICENSE | badblocks.dev -
-

- MIT License -

-
+ +

+ MIT License +

diff --git a/src/pages/tools.astro b/src/pages/tools.astro index 5e78e70..904a47c 100644 --- a/src/pages/tools.astro +++ b/src/pages/tools.astro @@ -1,5 +1,6 @@ --- import Layout from "@layouts/BaseLayout.astro"; +import PageHeader from "@components/PageHeader.astro"; --- @@ -15,7 +16,7 @@ import Layout from "@layouts/BaseLayout.astro";
-

Tools

+
Tool 1
Tool 2