Footer with environment, build, and hash #5
@@ -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
|
||||||
|
|||||||
5
src/components/Footer.astro
Normal file
5
src/components/Footer.astro
Normal 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
9
src/env.d.ts
vendored
Normal 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;
|
||||||
|
}
|
||||||
@@ -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>
|
||||||
Reference in New Issue
Block a user