diff --git a/.gitignore b/.gitignore index f387ca04..af43f1a0 100644 --- a/.gitignore +++ b/.gitignore @@ -127,6 +127,7 @@ venv.bak/ # mkdocs documentation /site +mkdocs.yml.backup # mypy .mypy_cache/ diff --git a/custom_theme/img/favicon.ico b/custom_theme/img/favicon.ico new file mode 100644 index 00000000..c2f45520 Binary files /dev/null and b/custom_theme/img/favicon.ico differ diff --git a/docs/scripts/deploy_docs.sh b/docs/scripts/deploy_docs.sh index 4b70388f..fcae055a 100755 --- a/docs/scripts/deploy_docs.sh +++ b/docs/scripts/deploy_docs.sh @@ -1,5 +1,22 @@ #!/bin/bash +rm -rf mkdocs.yml.backup mkdir -p ./_build/pydocmd/examples python docs/autogen.py -pydocmd gh-deploy + +# Haven't found a way to do this in a non-convoluted way yet. We need to append google_analytics to our mkdocs file, +# pydocmd doesn't copy google_analytics from the pydocmd file into the mkdocs.yml file, and it also deletes the file +# when pydocmd stops 'serving'. +# To get around this we: + +# 1. serve the docs locally +pydocmd serve & sleep 5 + +# 2. backup the generated mkdocs.yml file +cp mkdocs.yml mkdocs.yml.backup + +# 3. append to the backed up file +echo "google_analytics: ['UA-153895438-1', 'vortechsa.github.io']" >> mkdocs.yml.backup + +# 4. deploy to github pages using our backup file +pydocmd gh-deploy -f ./mkdocs.yml.backup diff --git a/pydocmd.yml b/pydocmd.yml index 6aaf66aa..6b5b5067 100644 --- a/pydocmd.yml +++ b/pydocmd.yml @@ -73,3 +73,4 @@ theme: name: readthedocs collapse_navigation: true search_index_only: false + custom_dir: custom_theme/ # https://github.com/mkdocs/mkdocs/issues/1671#issuecomment-543252346: