From efaa02ae20a722bab1d403e63980900083034e4e Mon Sep 17 00:00:00 2001 From: Corwin Perren Date: Wed, 9 Jul 2025 03:42:23 -0700 Subject: [PATCH 1/4] Footer with environment, build, and hash --- Dockerfile | 6 ++++-- src/components/Footer.astro | 5 +++++ src/env.d.ts | 9 +++++++++ src/layouts/BaseLayout.astro | 12 +++++++----- 4 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 src/components/Footer.astro create mode 100644 src/env.d.ts diff --git a/Dockerfile b/Dockerfile index 01cd830..aaff9d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,10 +16,12 @@ FROM build-deps AS build COPY . . ARG REPO_VERSION_HASH +ARG BUILD_ENVIRONMENT ARG PROJECT_VERSION -RUN echo $"PUBLIC_REPO_VERSION_HASH=${REPO_VERSION_HASH} \n\ - PUBLIC_PROJECT_VERSION=${PROJECT_VERSION}" >> .env +RUN echo "PUBLIC_REPO_VERSION_HASH=/"${REPO_VERSION_HASH}/" \n\ + BUILD_ENVIRONMENT=/"${BUILD_ENVIRONMENT}/" \n\ + PUBLIC_PROJECT_VERSION=/"${PROJECT_VERSION}/"" >> nope RUN npm run build FROM httpd:latest AS runtime diff --git a/src/components/Footer.astro b/src/components/Footer.astro new file mode 100644 index 0000000..0fad8a0 --- /dev/null +++ b/src/components/Footer.astro @@ -0,0 +1,5 @@ +--- +--- + \ No newline at end of file diff --git a/src/env.d.ts b/src/env.d.ts new file mode 100644 index 0000000..f2fd06c --- /dev/null +++ b/src/env.d.ts @@ -0,0 +1,9 @@ +interface ImportMetaEnv { + readonly PUBLIC_REPO_VERSION_HASH: string; + readonly PUBLIC_PROJECT_VERSION: string; + readonly BUILD_ENVIRONMENT: string; +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} \ No newline at end of file diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 00bc44c..9ae1a97 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -1,20 +1,22 @@ --- import '../styles/global.css' import Navbar from '../components/Navbar.astro'; +import Footer from '../components/Footer.astro'; -const pageTitle = Astro.props.title ? `${Astro.props.title} - Corwin Perren`: "Corwin Perren"; +const pageTitle = Astro.props.title ? `${Astro.props.title} - Corwin Perren` : "Corwin Perren"; --- - - + + {pageTitle} - +
- +
+