diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 3cd9b02..a4ca4f0 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -11,17 +11,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: '0' # checkout all commits to get the actual page revision time - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.x - name: Cache social plugin files - uses: actions/cache@v2 + uses: actions/cache@v3 with: key: ${{ github.ref }} path: .cache @@ -32,7 +32,10 @@ jobs: - name: Install Python dependencies run: pip install -r docs/requirements.txt - - name: Deploy MkDocs application + - name: Deploy MkDocs application with mike env: GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} - run: mkdocs gh-deploy --force + run: | + git config user.name ci-bot + git config user.email pcreighton429@gmail.com + mike deploy --push devel diff --git a/.gitignore b/.gitignore index 3847721..fc96f24 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ # Social plugin files .cache/ + +# mike files +site/ diff --git a/README.md b/README.md index 31854ea..f628e1b 100644 --- a/README.md +++ b/README.md @@ -32,3 +32,12 @@ Website for my notes on various programming-related topics. ### Command Line 1. `mkdocs serve` + +## Versioning + +1. Pull requests to main are deployed to `rolling`: `mike deploy --push rolling` +2. Releases are deployed to ``, which is aliased to `latest`: `mike deploy --push --update-aliases latest` + - Set this as default version: `mike set-default --push latest` + - Only have to do this once as setting alias as default then updating alias +3. Consider deploying pull requests to ``: `mike deploy --push devel-` + - Would have to delete on pull request to main: `mike delete --push devel-` diff --git a/docs/requirements.txt b/docs/requirements.txt index ee51492..aa2b810 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,5 @@ +cairosvg +mike mkdocs-git-revision-date-localized-plugin==1.* mkdocs-material==9.* - -# social plugin dependencies - -cairosvg pillow diff --git a/mkdocs.yml b/mkdocs.yml index 070bdca..133f4ce 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,6 +11,7 @@ edit_uri: "" # Configuration theme: name: material + custom_dir: overrides features: - content.code.annotate - navigation.expand diff --git a/overrides/main.html b/overrides/main.html new file mode 100644 index 0000000..8d9f505 --- /dev/null +++ b/overrides/main.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} + +{% block outdated %} + You're not viewing the latest version. + + Click here to go to latest. + +{% endblock %}