diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 2e2976a..e20aef5 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -7,7 +7,8 @@ LOGO=${LOGO//\//\\/} sed -i -e 's/HTMLTITLE/'"${TITLE}"'/g' /app/index.html # TypeScript replacement -sed -i -e 's/PAGETITLE = "My Website"/'"${TITLE}"'/g' /app/src/variables.ts -sed -i -e 's/PAGEICON = "\/logo\.png"/'"${LOGO}"'/g' /app/src/variables.ts +sed -i -e 's/(PAGETITLE = ")My Website(")/'"$1${TITLE}$2"'/g' /app/src/variables.ts +sed -i -e 's/(PAGEICON = ")\/logo\.png(")/'"$1${LOGO}$2"'/g' /app/src/variables.ts +sed -i -e 's/(SHOWHEADER = )false/'"$1${HEADER}"'/g' /app/src/variables.ts exec "$@" \ No newline at end of file diff --git a/dockerfile b/dockerfile index 1589279..eb1195a 100644 --- a/dockerfile +++ b/dockerfile @@ -11,6 +11,7 @@ ENV NODE_ENV production ENV TITLE "My Website" ENV LOGO "/logo.png" +ENV HEADER "true" EXPOSE 4173 diff --git a/readme.md b/readme.md index 7635a43..0596f30 100644 --- a/readme.md +++ b/readme.md @@ -78,6 +78,7 @@ services: environment: - TITLE=Starbase 80 # defaults to "My Website" - LOGO=/starbase80.jpg # defaults to /logo.png + - HEADER=true # defaults to true, set to false to hide the header (title and logo) volumes: - ./config.json:/app/src/config.json # required - ./public/favicon.ico:/app/public/favicon.ico # optional diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 91591a0..6ba7648 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -3,6 +3,7 @@ import { Header } from "../components/header"; import { ServiceCatalogs } from "../components/service-catalogs"; import userServices from "../config.json"; import { IServiceCatalog } from "../shared/types"; +import { SHOWHEADER } from "../variables"; interface IProps { title?: string; @@ -14,9 +15,11 @@ export const IndexPage: React.FunctionComponent = ({ icon, title }) => { return (
-
-
-
+ {SHOWHEADER && ( +
+
+
+ )}
diff --git a/src/variables.ts b/src/variables.ts index 0745a8f..13be908 100644 --- a/src/variables.ts +++ b/src/variables.ts @@ -1,2 +1,3 @@ export const PAGETITLE = "My Website"; export const PAGEICON = "/logo.png"; +export const SHOWHEADER = false;