Skip to content

Commit afa26b2

Browse files
authored
Merge pull request #1398 from hkad98/jkd/docs-prerender-api-ref
fix(docs): remove stale artifacts and fix draft deploy baseURL
2 parents 57d47dd + 6fadedb commit afa26b2

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

.github/workflows/netlify-deploy-v2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ jobs:
126126
working-directory: ./docs
127127
env:
128128
HUGO_ENV: production
129-
run: hugo --minify --baseURL https://www.gooddata.com/docs/python-sdk
129+
run: hugo --minify
130130
- name: Publish (draft)
131131
uses: netlify/actions/cli@master
132132
with:

scripts/assemble-versions.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ if [ -n "$highest_version" ]; then
4242
echo "Promoting version $highest_version to /latest"
4343
mv -f "./$content_dir/$highest_version" "./$content_dir/latest"
4444

45-
# Update version references in links.json
46-
if [ -f "./$content_dir/latest/links.json" ]; then
47-
sed "s|${highest_version}|latest|g" "./$content_dir/latest/links.json" > temp_links.json
48-
mv temp_links.json "./$content_dir/latest/links.json"
49-
fi
45+
5046
else
5147
echo "WARNING: No numbered version directory found to promote to latest"
5248
fi

scripts/generate-single-version.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ if git cat-file -e "$API_GEN_FILE" 2>/dev/null; then
5555

5656
# Generate API introspection data from this version's SDK
5757
python3 ../scripts/docs/json_builder.py
58-
mv -f data.json "$content_dir/$section/"
5958

6059
# Generate API reference markdown files
6160
python3 ../scripts/docs/python_ref_builder.py api_spec.toml \
62-
"./$content_dir/$section/data.json" "$section" "$content_dir"
61+
data.json "$section" "$content_dir"
62+
63+
# Clean up intermediate file (no longer needed after pre-rendering)
64+
rm -f data.json
6365
else
6466
echo "No json_builder.py on $branch, skipping API ref generation"
6567
fi

scripts/generate.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ for branch in "${branches_to_process[@]}" ; do
104104
rm -rf api_spec.toml
105105
fi
106106
python3 ../scripts/docs/json_builder.py
107-
mv -f data.json ./versioned_docs/"$target_section"/
108-
python3 ../scripts/docs/python_ref_builder.py api_spec.toml ./versioned_docs/"$target_section"/data.json "$target_section" versioned_docs
107+
python3 ../scripts/docs/python_ref_builder.py api_spec.toml data.json "$target_section" versioned_docs
108+
rm -f data.json
109109
fi
110110
fi
111111
done
@@ -119,10 +119,4 @@ highest_version=$(ls -v1 ./versioned_docs/ | grep -E '^[0-9]+.[0-9]+$' | sort -V
119119
echo "Moving ${highest_version} to /latest"
120120
mv -f ./versioned_docs/$highest_version ./versioned_docs/latest
121121

122-
# Replace "/${highest_version}/" with "/latest/" in links.json (if it exists)
123-
if [ -f "./versioned_docs/latest/links.json" ]; then
124-
sed "s|${highest_version}|latest|g" ./versioned_docs/latest/links.json > temp.json
125-
mv temp.json ./versioned_docs/latest/links.json
126-
fi
127-
128122
popd

0 commit comments

Comments
 (0)