This is a sample repo with a minimal example of the behavior I desire and describe in fralau/mkdocs_macros_plugin#75.
- docker
- make
- docker image with buildenv, python, mkdocs installed (see
ntno/ubuntu-build-base
)
- generate an environment variable file
- manually create file (see env/ for examples)
- OR use
buildenv
and a customvariables.yml
filemake docker make exec-build-env env=dev region=us-east-1 file="env/dev-us-east-1.env" exit
- add variables to
mkdocs.yml
in theextra
sectionextra: YOUR_VAR: !ENV [YOUR_ENV, 'some default value']
- reference variables in the theme:
{{ config.extra.YOUR_VAR }}
- reference variables in the docs:
{{ YOU_VAR }}
- load the environment variables and run
mkdocs
in the same shell session- manually source / run (assuming you have
mkdocs
andpip
requirements installed already)source "env/dev-us-east-1.env" && \ mkdocs serve
- loading handled via docker-compose argument in example Makefile
make serve file="env/dev-us-east-1.env"
- manually source / run (assuming you have