diff --git a/.travis.sh b/.travis.sh index 16eaf0bb9..d736add5d 100755 --- a/.travis.sh +++ b/.travis.sh @@ -23,6 +23,25 @@ # Exit, if one command fails set -e +# Create directory for overrides, so we don't clutter up the base theme with +# our custom adjustments for our own hosted documentation +mkdir -p overrides +cat > overrides/main.html <<-EOM + {% extends "base.html" %} + {% block scripts %} + {{ super() }} + + {% endblock %} +EOM + # Deploy documentation to GitHub pages if [ "$TRAVIS_BRANCH" == "master" -a "$TRAVIS_PULL_REQUEST" == "false" ]; then REMOTE="https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material" @@ -31,7 +50,15 @@ if [ "$TRAVIS_BRANCH" == "master" -a "$TRAVIS_PULL_REQUEST" == "false" ]; then git config --global user.name "${GH_NAME}" git config --global user.email "${GH_EMAIL}" git remote set-url origin $REMOTE - mkdocs gh-deploy --force + + # Install GitHub pages import helper and Material, so we can use it as a + # base template and add overrides + pip install ghp-import --user + python setup.py install + + # Build documentation with overrides and publish to GitHub pages + mkdocs build --theme material --theme-dir overrides + ghp-import --no-jekyll --force --push site fi # Terminate if we're not on a release branch diff --git a/MANIFEST.in b/MANIFEST.in index 83f1af4f6..7da058db1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ recursive-include material *.js *.css *.html *.svg *.png *.yml recursive-exclude site * +recursive-exclude src * recursive-exclude * __pycache__ recursive-exclude * *.py[co] include LICENSE diff --git a/mkdocs.yml b/mkdocs.yml index 7a8a0077a..14213a982 100755 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -121,7 +121,3 @@ pages: google_analytics: - !!python/object/apply:os.getenv ["GOOGLE_ANALYTICS_KEY"] - auto - -# Temporary scripts for testing -extra_javascript: - - https://staging.ginseng.ai/analytics.js