Skip to content

Commit 9ca67f2

Browse files
committed
ci(docs): update site URL before docs builds
Move the __SITE_URL__ substitution into dedicated pre-build steps for GitHub Pages and Read the Docs so zensical can run with the standard config file.
1 parent 74cff6d commit 9ca67f2

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

template/.github/workflows/python-docs.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@ jobs:
3434
activate-environment: true
3535
- name: Install dependencies
3636
run: uv sync --active --frozen --all-packages
37+
- name: Set site url
38+
run: sed --in-place 's|__SITE_URL__|${{ steps.config.outputs.base_url }}|g' 'zensical.toml'
3739
- name: Build
38-
run: |-
39-
config_file="$(mktemp --suffix='.toml')"
40-
sed 's|__SITE_URL__|${{ steps.config.outputs.base_url }}|g' 'zensical.toml' > "$config_file"
41-
zensical build --config-file "$config_file"
40+
run: zensical build
4241
- name: Upload Github Pages artifact
4342
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
4443
with:

template/.readthedocs.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ build:
2929
install:
3030
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --all-packages --link-mode copy
3131

32+
pre_build:
33+
- sed --in-place "s|__SITE_URL__|$READTHEDOCS_CANONICAL_URL|g" 'zensical.toml'
34+
3235
build:
3336
html:
34-
- |-
35-
config_file="$(mktemp --suffix='.toml')"
36-
sed "s|__SITE_URL__|$READTHEDOCS_CANONICAL_URL|g" 'zensical.toml' > "$config_file"
37-
zensical build --config-file "$config_file"
37+
- zensical build
3838

3939
post_build:
4040
- mkdir --parents --verbose "$READTHEDOCS_OUTPUT/html/"

0 commit comments

Comments
 (0)