Skip to content

Commit

Permalink
[docs] Ensure there is a latest page
Browse files Browse the repository at this point in the history
  • Loading branch information
gregnazario committed Feb 16, 2024
1 parent 00d3047 commit c39b25d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/@aptos-labs/ts-sdk-latest/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
permalink: /@aptos-labs/ts-sdk-latest
redirect_to:
- ts-sdk-1.7.0
---
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

This is a repository of all Aptos TypeScript SDK documentation by version.

- [Latest](@aptos-labs/ts-sdk-latest)
- [Stable - @aptos-labs/ts-sdk-1.7.0](@aptos-labs/ts-sdk-1.7.0)
- [Stable - @aptos-labs/ts-sdk-1.6.0](@aptos-labs/ts-sdk-1.6.0)
- [Stable - @aptos-labs/ts-sdk-1.5.1](@aptos-labs/ts-sdk-1.5.1)
Expand Down
7 changes: 6 additions & 1 deletion scripts/generateDocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ else
echo "Updating main docs page $INDEX_FILE with version $npm_package_version labeled with $LABEL";

# This inserts it at the 7th line and is a hack because there are exactly 7 lines until the first SDK version in the file
FIRST_LINE=7
FIRST_LINE=8
NEXT_LINE=$((FIRST_LINE + 1))

# Add in the middle line the new version.
Expand All @@ -41,3 +41,8 @@ else
tail -n +$NEXT_LINE $INDEX_FILE;
} > $INDEX_FILE.tmp && mv $INDEX_FILE.tmp $INDEX_FILE
fi

# Now update the redirect
REDIRECT_FILE='docs/@aptos-labs/ts-sdk-latest/index.html';
$(sed -i.bak "s/- ts-sdk-.*/- ts-sdk-$npm_package_version/" $REDIRECT_FILE)
echo "Updated redirect $REDIRECT_FILE with version $npm_package_version for latest";

0 comments on commit c39b25d

Please sign in to comment.