From dbbed2d2a5f09b7adeab3e1caf85b274d50d9082 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Sun, 1 Oct 2023 21:11:30 -0700 Subject: [PATCH] docs: restore directory structure of the website The `offline` plugin added to the MkDocs config in commit 772e2b8 ended up changing the directory structure of the website, see the resulting commit 56aec196. **Before** that commit, the following URLs were valid: and was invalid. The situation described above should be restored by this commit. **After** 772e2b8 and before this commit, the following URLs were valid: and was invalid. This commit is likely to break the version switcher between v0.9.0 and newer versions. The breakage would be minimized if this is merged shortly before a release (but with enough time to test it out). Alternatively, I could try to fix up the docs for that version. We could also consciously decide to leave things as they are now. The problem was noticed by @hooper, who noticed URLs in their browser history that were no longer valid. --- .github/workflows/release.yml | 2 +- mkdocs-offline.yml | 10 ++++++++++ mkdocs.yml | 1 - 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 mkdocs-offline.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 197f045b7..2119ed619 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -92,7 +92,7 @@ jobs: - name: Compile docs and zip them up run: | poetry install - poetry run -- mkdocs build --no-directory-urls + poetry run -- mkdocs build -f mkdocs-offline.yml archive="jj-${{ github.event.release.tag_name }}-docs-html.tar.gz" tar czf "$archive" -C "rendered-docs" . echo "ASSET=$archive" >> $GITHUB_ENV diff --git a/mkdocs-offline.yml b/mkdocs-offline.yml new file mode 100644 index 000000000..e9c3ca177 --- /dev/null +++ b/mkdocs-offline.yml @@ -0,0 +1,10 @@ +# This config is good if you plan to use the rendered docs from +# your file system. To use, run: +# poetry run -- mkdocs -f mkdocs-offline.yml +INHERIT: 'mkdocs.yml' +plugins: + - offline +# Turns out the `offline` plugin forces the following +# option no matter what, and therefore shouldn't be +# used in the main config file. +use_directory_urls: false diff --git a/mkdocs.yml b/mkdocs.yml index f9ebcb1e4..8601d129e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -12,7 +12,6 @@ extra: version: provider: mike plugins: - - offline - search - redirects: redirect_maps: