Skip to content

Commit 1f797b7

Browse files
Versions file fixed (#494)
* fixed versions.sh * furnished
1 parent ede7aa5 commit 1f797b7

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

assets/scripts/versions.sh

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ MINOR_TAGS=$(echo "$STABLE_TAGS" | grep -Eo 'v[0-9]+\.[0-9]+(\.0)?$')
2020
# Set the minimum version to include in the "Previous Versions" section
2121
MIN_VERSION="v0.31.0"
2222

23+
# Remove bug-fix version number from the display of a version
24+
remove_bugfix() {
25+
echo "$1" | sed -E 's/\.[0-9]$//'
26+
}
27+
2328
# versions.qmd file will be generated from this content
2429
VERSIONS_CONTENT="---
2530
pagetitle: Versions
@@ -39,12 +44,7 @@ include-in-header:
3944
# Latest Version
4045
| | | |
4146
| --- | --- | --- |
42-
| ${LATEST_VERSION} | [Documention](versions/${LATEST_VERSION}/) | [Changelog](changelog.qmd) |
43-
44-
# Stable Version
45-
| | |
46-
| --- | --- |
47-
| ${STABLE_VERSION} | [Documention](versions/${STABLE_VERSION}/) |
47+
| $(remove_bugfix "$LATEST_VERSION") | [Documention](versions/${LATEST_VERSION}/) | [Changelog](changelog.qmd) |
4848
4949
# Previous Versions
5050
| | |
@@ -55,7 +55,9 @@ for MINOR_TAG in $MINOR_TAGS; do
5555
if [ "$MINOR_TAG" != "$LATEST_VERSION" ] && [ "$MINOR_TAG" != "$STABLE_VERSION" ] && [ "$MINOR_TAG" \> "$MIN_VERSION" ]; then
5656
# Find the latest bug fix version for the current minor version
5757
LATEST_BUG_FIX=$(echo "$STABLE_TAGS" | grep "^${MINOR_TAG%.*}" | sort -r | head -n 1)
58-
VERSIONS_CONTENT="${VERSIONS_CONTENT}| ${MINOR_TAG} | [Documention](versions/${LATEST_BUG_FIX}/) |
58+
# Remove trailing .0 from display version
59+
DISPLAY_MINOR_TAG=$(remove_bugfix "$MINOR_TAG")
60+
VERSIONS_CONTENT="${VERSIONS_CONTENT}| ${DISPLAY_MINOR_TAG} | [Documention](versions/${LATEST_BUG_FIX}/) |
5961
"
6062
fi
6163
done
@@ -67,14 +69,14 @@ Documentation for archived versions is available on our deprecated documentation
6769
6870
| | |
6971
| --- | --- |
70-
| v0.31.0 | [Documention](../v0.31.4/) |
71-
| v0.30.0 | [Documention](../v0.30.9/) |
72-
| v0.29.0 | [Documention](../v0.29.3/) |
73-
| v0.28.0 | [Documention](../v0.28.3/) |
74-
| v0.27.0 | [Documention](../v0.27.0/) |
75-
| v0.26.0 | [Documention](../v0.26.6/) |
76-
| v0.25.0 | [Documention](../v0.25.3/) |
77-
| v0.24.0 | [Documention](../v0.24.4/) |
72+
| v0.31 | [Documention](../v0.31.4/) |
73+
| v0.30 | [Documention](../v0.30.9/) |
74+
| v0.29 | [Documention](../v0.29.3/) |
75+
| v0.28 | [Documention](../v0.28.3/) |
76+
| v0.27 | [Documention](../v0.27.0/) |
77+
| v0.26 | [Documention](../v0.26.6/) |
78+
| v0.25 | [Documention](../v0.25.3/) |
79+
| v0.24 | [Documention](../v0.24.4/) |
7880
"
7981

8082
# Write the content to the versions.qmd file

0 commit comments

Comments
 (0)