From 63fc4373b29189e55859b6495fdac0523f697aaa Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 22 May 2025 16:57:29 -0500 Subject: [PATCH] feat: try to fix the prod deployment --- astro.config.mjs | 4 ++++ scripts/deploy.sh | 0 src/components/Header.astro | 39 +++++++++++++++++++++++++++++++++---- src/pages/index.astro | 2 +- 4 files changed, 40 insertions(+), 5 deletions(-) mode change 100644 => 100755 scripts/deploy.sh diff --git a/astro.config.mjs b/astro.config.mjs index 952752f..3d05bdc 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -4,6 +4,10 @@ import remarkMath from "remark-math"; import rehypeKatex from "rehype-katex"; export default defineConfig({ + trailingSlash: "always", + build: { + format: "directory", + }, integrations: [ mdx({ remarkPlugins: [remarkMath], diff --git a/scripts/deploy.sh b/scripts/deploy.sh old mode 100644 new mode 100755 diff --git a/src/components/Header.astro b/src/components/Header.astro index a6210eb..4f78e03 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -2,8 +2,11 @@ const path = Astro.url.pathname; const isHome = path === "/" || path === "/index.html"; -// Determine topic from path function getTopic() { +if (path.startsWith("/about")) { + return "/about"; + } + const pathname = path.split("/"); if (pathname.length === 2 && pathname[1].endsWith(".html")) { @@ -28,16 +31,14 @@ const promptText = topic ? `barrett@ruth:~$ ${topic}` : "barrett@ruth:~$"; diff --git a/src/pages/index.astro b/src/pages/index.astro index 1c9c43e..4565f68 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -152,7 +152,7 @@ Object.keys(postsByCategory).forEach((category) => { .pop() .replace(/\.mdx?$/, ""); - link.href = `/posts/${topic}/${slug}`; + link.href = `/posts/${topic}/${slug}/`; link.textContent = post.data.title; link.style.textDecoration = "underline";