From 6fadedb4cc061d4882936ec20c3c9fdd39ff1fad Mon Sep 17 00:00:00 2001 From: Jan Kadlec Date: Fri, 6 Mar 2026 15:55:01 +0100 Subject: [PATCH] fix(docs): remove stale artifacts and fix draft deploy baseURL Remove leftover data.json and links.json handling that is no longer needed after pre-rendering API reference HTML in Python. The link resolution is now baked into the HTML at generation time, so these intermediate files serve no purpose. Also remove --baseURL from the V2 draft workflow so Netlify draft deploys are browsable instead of redirecting to production. jira: trivial risk: nonprod --- .github/workflows/netlify-deploy-v2.yaml | 2 +- scripts/assemble-versions.sh | 6 +----- scripts/generate-single-version.sh | 6 ++++-- scripts/generate.sh | 10 ++-------- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/netlify-deploy-v2.yaml b/.github/workflows/netlify-deploy-v2.yaml index 50b96ac59..b09819086 100644 --- a/.github/workflows/netlify-deploy-v2.yaml +++ b/.github/workflows/netlify-deploy-v2.yaml @@ -126,7 +126,7 @@ jobs: working-directory: ./docs env: HUGO_ENV: production - run: hugo --minify --baseURL https://www.gooddata.com/docs/python-sdk + run: hugo --minify - name: Publish (draft) uses: netlify/actions/cli@master with: diff --git a/scripts/assemble-versions.sh b/scripts/assemble-versions.sh index 435ad3581..8a4b604e2 100755 --- a/scripts/assemble-versions.sh +++ b/scripts/assemble-versions.sh @@ -42,11 +42,7 @@ if [ -n "$highest_version" ]; then echo "Promoting version $highest_version to /latest" mv -f "./$content_dir/$highest_version" "./$content_dir/latest" - # Update version references in links.json - if [ -f "./$content_dir/latest/links.json" ]; then - sed "s|${highest_version}|latest|g" "./$content_dir/latest/links.json" > temp_links.json - mv temp_links.json "./$content_dir/latest/links.json" - fi + else echo "WARNING: No numbered version directory found to promote to latest" fi diff --git a/scripts/generate-single-version.sh b/scripts/generate-single-version.sh index 712550314..44c004f5c 100755 --- a/scripts/generate-single-version.sh +++ b/scripts/generate-single-version.sh @@ -55,11 +55,13 @@ if git cat-file -e "$API_GEN_FILE" 2>/dev/null; then # Generate API introspection data from this version's SDK python3 ../scripts/docs/json_builder.py - mv -f data.json "$content_dir/$section/" # Generate API reference markdown files python3 ../scripts/docs/python_ref_builder.py api_spec.toml \ - "./$content_dir/$section/data.json" "$section" "$content_dir" + data.json "$section" "$content_dir" + + # Clean up intermediate file (no longer needed after pre-rendering) + rm -f data.json else echo "No json_builder.py on $branch, skipping API ref generation" fi diff --git a/scripts/generate.sh b/scripts/generate.sh index c97873358..4829aaed4 100755 --- a/scripts/generate.sh +++ b/scripts/generate.sh @@ -104,8 +104,8 @@ for branch in "${branches_to_process[@]}" ; do rm -rf api_spec.toml fi python3 ../scripts/docs/json_builder.py - mv -f data.json ./versioned_docs/"$target_section"/ - python3 ../scripts/docs/python_ref_builder.py api_spec.toml ./versioned_docs/"$target_section"/data.json "$target_section" versioned_docs + python3 ../scripts/docs/python_ref_builder.py api_spec.toml data.json "$target_section" versioned_docs + rm -f data.json fi fi done @@ -119,10 +119,4 @@ highest_version=$(ls -v1 ./versioned_docs/ | grep -E '^[0-9]+.[0-9]+$' | sort -V echo "Moving ${highest_version} to /latest" mv -f ./versioned_docs/$highest_version ./versioned_docs/latest -# Replace "/${highest_version}/" with "/latest/" in links.json (if it exists) -if [ -f "./versioned_docs/latest/links.json" ]; then - sed "s|${highest_version}|latest|g" ./versioned_docs/latest/links.json > temp.json - mv temp.json ./versioned_docs/latest/links.json -fi - popd