Skip to content

Commit 8a3a37d

Browse files
committed
fix(docs): add post_checkout job for dynamic symlink creation in Read the Docs
2 parents 69c012e + 5ff8f9d commit 8a3a37d

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

.readthedocs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,19 @@ build:
1010
tools:
1111
python: "3.13"
1212

13+
jobs:
14+
post_checkout:
15+
# Set up symbolic link based on RTD project name
16+
- |
17+
if [ "$PROJECT_VERSION" = "brainpy-version2" ]; then
18+
ln -sf docs_version2 docs_build
19+
else
20+
ln -sf docs docs_build
21+
fi
22+
1323
# Build documentation using the wrapper conf.py
1424
# The wrapper will dynamically load the correct docs based on READTHEDOCS_PROJECT
25+
# Build documentation using the symlinked directory
1526
sphinx:
1627
configuration: docs_build/conf.py
1728

docs_version2/.readthedocs.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)