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