adds ability to override default font family

This commit is contained in:
jweaver 2023-03-30 20:27:13 -06:00
parent d4cd6f7fbd
commit 68ada43409
4 changed files with 4 additions and 1 deletions

View File

@ -30,6 +30,7 @@ ENV BASE_PATH=
ENV SPEC_URL="http://petstore.swagger.io/v2/swagger.json"
ENV PORT=80
ENV REDOC_OPTIONS=
ENV FONT_FAMILY_URL="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700"
# copy files to the nginx folder
COPY --from=0 build/bundles /usr/share/nginx/html

View File

@ -49,6 +49,7 @@ Another issue with OpenShift is that the default exposed port `80` cannot be use
- `SPEC_URL` (default `"http://petstore.swagger.io/v2/swagger.json"`) - URL to spec
- `PORT` (default `80`) - nginx port
- `REDOC_OPTIONS` (optional) - [`<redoc>` tag attributes](https://github.com/Redocly/redoc#redoc-tag-attributes)
- `FONT_FAMILY_URL` (default `"https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700"`) - URL to font family
## Build

View File

@ -7,6 +7,7 @@ sed -i -e "s|%PAGE_FAVICON%|$PAGE_FAVICON|g" /usr/share/nginx/html/index.html
sed -i -e "s|%BASE_PATH%|$BASE_PATH|g" /usr/share/nginx/html/index.html
sed -i -e "s|%SPEC_URL%|$SPEC_URL|g" /usr/share/nginx/html/index.html
sed -i -e "s|%REDOC_OPTIONS%|${REDOC_OPTIONS}|g" /usr/share/nginx/html/index.html
sed -i -e "s|%FONT_FAMILY_URL%|${FONT_FAMILY_URL}|g" /usr/share/nginx/html/index.html
sed -i -e "s|\(listen\s*\) [0-9]*|\1 ${PORT}|g" /etc/nginx/nginx.conf
exec nginx -g 'daemon off;'

View File

@ -16,7 +16,7 @@
}
</style>
<link
href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700"
href="%FONT_FAMILY_URL%"
rel="stylesheet"
/>
</head>