diff --git a/scripts/build_gh_pages b/scripts/build_gh_pages index 802d618c1a8..250750cb7a4 100755 --- a/scripts/build_gh_pages +++ b/scripts/build_gh_pages @@ -28,35 +28,23 @@ git clone git@github.com:project-oak/oak.git --branch=gh-pages --depth=1 "${TARG # everything within that directory. rm --recursive --force "${TARGET_DIR:?}"/* -readonly SRC_SUBDIRS=(sdk/rust oak/server/rust) -readonly DOC_SUBDIRS=(sdk server) - -doc_gen() { - local srcdir=$1 - local docdir=$2 - ( - cd "${srcdir}" || exit - # Remove previously generated artifacts, since `cargo doc` only regenerates new or modified - # files, but does not remove artifacts generated from now-removed files. - rm --recursive --force ./target/doc - cargo doc --no-deps - cargo deadlinks - cp --recursive ./target/doc "${TARGET_DIR}/${docdir}" - ) -} - -for ii in "${!SRC_SUBDIRS[@]}"; do - doc_gen "${SRC_SUBDIRS[$ii]}" "${DOC_SUBDIRS[$ii]}" -done - +# Remove previously generated artifacts, since `cargo doc` only regenerates new or modified +# files, but does not remove artifacts generated from now-removed files. +rm --recursive --force ./target/doc +cargo doc --no-deps +cargo deadlinks +cp --recursive ./target/doc "${TARGET_DIR}" + +# The docs generated from the Cargo workspace do not include a workspace-level index, so we generate +# one here and redirect to the Oak SDK documentation. cat <<-END > "${TARGET_DIR}/index.html" - + -

Oak SDK main page

+

Oak SDK main page

END