Skip to content

Commit

Permalink
Merge pull request #206 from VorTECHsa/google-analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
KitBurgess committed Jun 8, 2020
2 parents 8d0792f + a3a0be2 commit b44cbce
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ venv.bak/

# mkdocs documentation
/site
mkdocs.yml.backup

# mypy
.mypy_cache/
Expand Down
Binary file added custom_theme/img/favicon.ico
Binary file not shown.
19 changes: 18 additions & 1 deletion docs/scripts/deploy_docs.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions pydocmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

0 comments on commit b44cbce

Please sign in to comment.