Skip to content

Commit

Permalink
docs: set site_url to fix broken 404 page on RTD (#176)
Browse files Browse the repository at this point in the history
Closes #443

### Summary of Changes

The 404 page was previously not properly rendered on Read the Docs
(RTD). This PR overrides the build commands of RTD. While this makes the
404 page work properly, it also removes the RTD flyout to select a
version. For now, however, we deem the 404 page as more essential.

Once readthedocs/readthedocs.org#8529 is done,
we can use the default build again to make everything work as expected.
  • Loading branch information
lars-reimann authored Jul 11, 2023
1 parent 44005f4 commit de04e2a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
site_name: Safe-DS Python Library
repo_url: https://github.com/Safe-DS/Stdlib
repo_name: Safe-DS/Stdlib
edit_uri: edit/main/docs/
site_url: !ENV READTHEDOCS_CANONICAL_URL

nav:
- Home:
Expand Down
22 changes: 15 additions & 7 deletions readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@ build:
os: ubuntu-22.04
tools:
python: '3.10'
jobs:
# https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-poetry
post_create_environment:
- pip install poetry
- poetry config virtualenvs.create false
post_install:
- poetry install --with docs
commands:
- pip install poetry
- poetry config virtualenvs.create false
- poetry install --with docs
- cat mkdocs.yml
- mkdocs build --clean --site-dir $READTHEDOCS_OUTPUT/html --config-file mkdocs.yml
# Once https://github.com/readthedocs/readthedocs.org/issues/8529 is fixed, replace the commands above with the
# following to use the default RTD build steps again:
# jobs:
# # https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-poetry
# post_create_environment:
# - pip install poetry
# - poetry config virtualenvs.create false
# post_install:
# - poetry install --with docs

mkdocs:
configuration: mkdocs.yml

0 comments on commit de04e2a

Please sign in to comment.