diff --git a/.readthedocs.yml b/.readthedocs.yml index 71001e9ec4fe..c10caba1856d 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,7 +5,25 @@ # Required version: 2 +python: + install: + - requirements: requirements/docs.txt + - requirements: requirements/user-docs.txt + build: os: ubuntu-22.04 tools: python: "3.11" + commands: + - | + if [ "$READTHEDOCS_PROJECT" = "warehouse" ] + then + make -C docs/ html; + mv docs/_build/html _readthedocs/html; + fi + - | + if [ "$READTHEDOCS_PROJECT" = "docspypiorg" ] + then + mkdocs build -f user-docs/mkdocs.yml; + mv user-docs/site _readthedocs/html; + fi diff --git a/bin/user-docs b/bin/user-docs index b034c2765e1f..48bf4a78fd65 100755 --- a/bin/user-docs +++ b/bin/user-docs @@ -10,4 +10,4 @@ export LANG="${ENCODING:-en_US.UTF-8}" # Print all the following commands set -x -mkdocs build -f mkdocs.yml +mkdocs build -f user-docs/mkdocs.yml diff --git a/docker-compose.yml b/docker-compose.yml index 12d0e132705d..1fe6868f1cde 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -186,9 +186,8 @@ services: context: . args: DEVEL: "yes" - command: mkdocs serve -a 0.0.0.0:8000 -f mkdocs.yml + command: mkdocs serve -a 0.0.0.0:8000 -f user-docs/mkdocs.yml volumes: - - ./mkdocs.yml:/opt/warehouse/src/mkdocs.yml:z - ./user-docs:/opt/warehouse/src/user-docs:z ports: - "10000:8000" diff --git a/mkdocs.yml b/user-docs/mkdocs.yml similarity index 94% rename from mkdocs.yml rename to user-docs/mkdocs.yml index af72e7fe84db..d269a5872372 100644 --- a/mkdocs.yml +++ b/user-docs/mkdocs.yml @@ -1,5 +1,5 @@ site_name: PyPI Docs -docs_dir: user-docs +docs_dir: . theme: name: material logo: assets/logo.png