Footer with environment, build, and hash #5

Merged
caperren merged 4 commits from website-content-updates into main 2025-07-09 11:03:26 +00:00
4 changed files with 25 additions and 7 deletions
Showing only changes of commit efaa02ae20 - Show all commits

View File

@@ -16,10 +16,12 @@ FROM build-deps AS build
COPY . . COPY . .
ARG REPO_VERSION_HASH ARG REPO_VERSION_HASH
ARG BUILD_ENVIRONMENT
ARG PROJECT_VERSION ARG PROJECT_VERSION
RUN echo $"PUBLIC_REPO_VERSION_HASH=${REPO_VERSION_HASH} \n\ RUN echo "PUBLIC_REPO_VERSION_HASH=/"${REPO_VERSION_HASH}/" \n\
PUBLIC_PROJECT_VERSION=${PROJECT_VERSION}" >> .env BUILD_ENVIRONMENT=/"${BUILD_ENVIRONMENT}/" \n\
PUBLIC_PROJECT_VERSION=/"${PROJECT_VERSION}/"" >> nope
RUN npm run build RUN npm run build
FROM httpd:latest AS runtime FROM httpd:latest AS runtime

View File

@@ -0,0 +1,5 @@
---
---
<footer class="flex justify-center items-center text-center">
{import.meta.env.BUILD_ENVIRONMENT || "development"} | {import.meta.env.PUBLIC_REPO_VERSION_HASH || "invalid"}@{import.meta.env.PUBLIC_PROJECT_VERSION || "0.0.0"}
</footer>

9
src/env.d.ts vendored Normal file
View File

@@ -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;
}

View File

@@ -1,20 +1,22 @@
--- ---
import '../styles/global.css' import '../styles/global.css'
import Navbar from '../components/Navbar.astro'; 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";
--- ---
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>{pageTitle}</title> <title>{pageTitle}</title>
</head> </head>
<body> <body>
<Navbar /> <Navbar/>
<main style="padding: 2rem;"> <main style="padding: 2rem;">
<slot /> <slot/>
</main> </main>
<Footer/>
</body> </body>
</html> </html>