@@ -18,14 +18,13 @@ current_branch=$(git rev-parse --abbrev-ref HEAD)
18
18
# Initialize the version_info list for Python configuration
19
19
version_info_content=" html_theme_options['version_info'] = ["
20
20
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"
22
25
for i in " ${! tags[@]} " ; do
23
26
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 ']}"
29
28
done
30
29
31
30
# Close the version_info list
@@ -36,14 +35,13 @@ git fetch --all --tags
36
35
37
36
# Loop through all tags and generate Sphinx documentation for each with specific conditions
38
37
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
+
39
43
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)
47
45
git checkout $tag
48
46
python docs/update_quairkit_rst.py
49
47
sphinx-build docs/sphinx_src docs/api/$tag
@@ -52,6 +50,7 @@ for tag in "${tags[@]}"; do
52
50
v0.2.0 | * )
53
51
git checkout $tag
54
52
python docs/update_quairkit_rst.py
53
+ cp -r tutorials docs/sphinx_src/
55
54
sphinx-build docs/sphinx_src docs/api/$tag
56
55
rm -rf docs/sphinx_src
57
56
;;
0 commit comments