Skip to content

Commit a613e6b

Browse files
committed
Added correct base url
1 parent 9da6c02 commit a613e6b

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/link_check.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ jobs:
3131
- name: Build documentation
3232
run: mkdocs build --strict
3333

34+
- name: Determine base URL
35+
id: base-url
36+
run: |
37+
if [ "${{ github.event_name }}" = "pull_request" ]; then
38+
echo "url=https://ez-systems-developer-documentation--${{ github.event.pull_request.number }}.com.readthedocs.build/en/${{ github.event.pull_request.number }}/" >> "$GITHUB_OUTPUT"
39+
elif [[ "${{ github.ref_name }}" =~ ^[0-9]+\.[0-9]+$ ]]; then
40+
echo "url=https://doc.ibexa.co/en/${{ github.ref_name }}/" >> "$GITHUB_OUTPUT"
41+
else
42+
echo "url=https://doc.ibexa.co/en/latest/" >> "$GITHUB_OUTPUT"
43+
fi
44+
3445
- name: Restore lychee cache
3546
uses: actions/cache@v4
3647
with:
@@ -47,6 +58,7 @@ jobs:
4758
--config lychee.toml
4859
--cache
4960
--cache-exclude-status "500.."
61+
--base-url ${{ steps.base-url.outputs.url }}
5062
site
5163
fail: true
5264
env:

lychee.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,6 @@ exclude_all_private = true
102102
# Must match the directory passed as input to lychee.
103103
root_dir = "site"
104104

105-
# Base URL for resolving relative links in HTML files.
106-
base_url = "https://doc.ibexa.co/en/latest/"
105+
# base_url is intentionally omitted here — it is passed dynamically via
106+
# --base-url in the GitHub Actions workflow, computed from the branch name
107+
# (e.g. master → /en/latest/, 5.0 → /en/5.0/) or from READTHEDOCS_CANONICAL_URL.

0 commit comments

Comments
 (0)