Skip to content

Commit

Permalink
Change organization of documentation for GitHub pages
Browse files Browse the repository at this point in the history
  • Loading branch information
hansec committed Jul 9, 2024
1 parent 574a2d9 commit f810fe4
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions src/docs/build_doc_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,20 @@
> doc_versions.txt
MENU_PATCH='menudata.children.push({text:"Versions",url:"index.html",children:['

# Get information about git environment (commit, releases, etc.)
GIT_DESC=$(git describe --tags --match 'v*')
# Get information about git environment (commit, release)
COMMIT_HASH=$(git rev-parse --short HEAD)
CURR_RELEASE=$(git describe --tags --abbrev=0)
RESET_HASH=$(git rev-parse HEAD)

# Build current commit if not a release commit
if [[ "$GIT_DESC" =~ -([0-9]+)-([a-z0-9]{8}) ]]
then
COMMIT_HASH=$(git rev-parse --short HEAD)
mkdir $COMMIT_HASH && cd $COMMIT_HASH

# Build current version
cmake -DOFT_BUILD_DOCS:BOOL=ON -DOFT_DOCS_ONLY:BOOL=ON -DOFT_PACKAGE_NIGHTLY:BOOL=ON ../../src
make docs
cd ..
echo $COMMIT_HASH >> doc_versions.txt
MENU_PATCH+='{text:"'$COMMIT_HASH'",url:"'../$COMMIT_HASH'/index.html"},'

# Checkout most recent release
git checkout $CURR_RELEASE
fi
# Build current commit
mkdir latest && cd latest
cmake -DOFT_BUILD_DOCS:BOOL=ON -DOFT_DOCS_ONLY:BOOL=ON -DOFT_PACKAGE_NIGHTLY:BOOL=ON ../../src
make docs
cd ..
echo "latest" >> doc_versions.txt
MENU_PATCH+='{text:"'$COMMIT_HASH'",url:"../latest/index.html"},'

# Build most recent release
git checkout $CURR_RELEASE
mkdir $CURR_RELEASE && cd $CURR_RELEASE
cmake -DOFT_BUILD_DOCS:BOOL=ON -DOFT_DOCS_ONLY:BOOL=ON -DOFT_PACKAGE_NIGHTLY:BOOL=OFF ../../src
make docs
Expand Down

0 comments on commit f810fe4

Please sign in to comment.