From f8b7858b5200fc26259e87392f2271717455df73 Mon Sep 17 00:00:00 2001 From: ethangardner Date: Thu, 12 Dec 2024 17:22:13 -0500 Subject: [PATCH] update image path to account for non-root urls --- apps/spotlight/src/components/Footer.astro | 3 ++- apps/spotlight/src/components/Header.astro | 5 ++--- apps/spotlight/src/routes.ts | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/spotlight/src/components/Footer.astro b/apps/spotlight/src/components/Footer.astro index 9800cad5..9213b964 100644 --- a/apps/spotlight/src/components/Footer.astro +++ b/apps/spotlight/src/components/Footer.astro @@ -1,6 +1,7 @@ --- import { type GithubRepository, getBranchTreeUrl } from '../lib/github.js'; import { Image } from 'astro:assets'; +import { getBaseUrl } from '../routes'; type Props = { github: GithubRepository; @@ -25,7 +26,7 @@ const { github } = Astro.props; class="usa-identifier__logo GSAFooter__logo" > GSA.gov home. { if (url === Astro.url.pathname) { @@ -33,7 +32,7 @@ const showAboutContent = false; 10x Forms Platform home { return `${context.baseUrl}design/index.html`; }; +export const getBaseUrl = () => { + const context = getAppContext(); + return context.baseUrl; +}; + export const getAboutUrl = () => { const context = getAppContext(); return `${context.baseUrl}about/index.html`;