diff --git a/docs/build.sh b/docs/build.sh index b39a0539a6..0af3289655 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -1,10 +1,25 @@ #!/bin/sh -# This builds docs using docusaurus. COMMIT=$(git rev-parse HEAD) -echo "building docusaurus main docs" -(git clean -fdx && git reset --hard && git checkout $COMMIT) -npm ci && npm run build -mv build ~/output -echo "done building docusaurus main docs" -# echo $DOCS_DOMAIN > ~/output/CNAME +for version in $(jq -r .[] versions.json); do + echo "Building docusaurus $version docs ..." + git checkout $version + npm cache clean --force && npm install && npm run docusaurus docs:version $version + + # versions.json / package-lock.json, get mangled by Docusarus causing problems + rm versions.json package-lock.json +done + +# Rebuild main/commit level docs +echo "Building docusaurus main docs ..." + +rm package-lock.json +git checkout $COMMIT + +# Move figures over +cp -R figures ./versioned_docs/ + +# Actual build +npm install && npm run build + +echo "Finished building docs ... " \ No newline at end of file diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 46a3678310..5b3cf290d9 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -87,7 +87,7 @@ const config = { { type: "docsVersionDropdown", position: "left", - dropdownActiveClassDisabled: true, + dropdownActiveClassDisabled: false, }, ], }, diff --git a/docs/versions.json b/docs/versions.json new file mode 100644 index 0000000000..033dbd0bdd --- /dev/null +++ b/docs/versions.json @@ -0,0 +1,5 @@ +[ + "v3.1.0", + "v2.2.0-provider-lsm", + "v2.1.0-provider-lsm" +] \ No newline at end of file