Skip to content

Commit e702e67

Browse files
committed
Update version
1 parent b4498d9 commit e702e67

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

version.sh

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@ current_branch=$(git rev-parse --abbrev-ref HEAD)
1818
# Initialize the version_info list for Python configuration
1919
version_info_content="html_theme_options['version_info'] = ["
2020

21-
# Populate the version_info list with tag data
21+
# Add the "latest" version to the version_info list first
22+
version_info_content+="{'version': 'latest', 'title': 'latest', 'aliases': ['latest']}"
23+
24+
# Populate the version_info list with tag data, appending after "latest"
2225
for i in "${!tags[@]}"; do
2326
tag="${tags[$i]}"
24-
if [ $i -eq 0 ]; then
25-
version_info_content+="{'version': '$tag', 'title': '$tag', 'aliases': ['$tag']}"
26-
else
27-
version_info_content+=", {'version': '$tag', 'title': '$tag', 'aliases': ['$tag']}"
28-
fi
27+
version_info_content+=", {'version': '$tag', 'title': '$tag', 'aliases': ['$tag']}"
2928
done
3029

3130
# Close the version_info list
@@ -36,14 +35,13 @@ git fetch --all --tags
3635

3736
# Loop through all tags and generate Sphinx documentation for each with specific conditions
3837
for tag in "${tags[@]}"; do
38+
# Skip the "latest" version if it exists in the tags
39+
if [ "$tag" == "latest" ]; then
40+
continue
41+
fi
42+
3943
case $tag in
40-
v0.0.1)
41-
git checkout $tag
42-
python docs/update_avocado_rst.py
43-
sphinx-build docs/source docs/api/$tag
44-
rm -rf docs/source
45-
;;
46-
v0.1.0 | *)
44+
v0.1.0)
4745
git checkout $tag
4846
python docs/update_quairkit_rst.py
4947
sphinx-build docs/sphinx_src docs/api/$tag
@@ -52,6 +50,7 @@ for tag in "${tags[@]}"; do
5250
v0.2.0 | *)
5351
git checkout $tag
5452
python docs/update_quairkit_rst.py
53+
cp -r tutorials docs/sphinx_src/
5554
sphinx-build docs/sphinx_src docs/api/$tag
5655
rm -rf docs/sphinx_src
5756
;;

0 commit comments

Comments
 (0)