From 527312311f4846db8dd55b6b62c6c321bd2d5792 Mon Sep 17 00:00:00 2001 From: mtail Date: Wed, 19 Jun 2019 14:51:12 -0700 Subject: [PATCH] Another fix for archives. --- scripts/gen_archive_site.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/gen_archive_site.sh b/scripts/gen_archive_site.sh index 280e793c22..15471a72ea 100755 --- a/scripts/gen_archive_site.sh +++ b/scripts/gen_archive_site.sh @@ -3,6 +3,8 @@ # Build the archive site # +BASEURL="$1" + # List of name:tagOrBranch TOBUILD=( v1.1:release-1.1 @@ -37,11 +39,12 @@ for rel in "${TOBUILD[@]}" do NAME=$(echo $rel | cut -d : -f 1) TAG=$(echo $rel | cut -d : -f 2) - BASEURL=$(echo /$NAME) - echo "### Building '$NAME' from $TAG for $BASEURL" + URL=$(echo ${BASEURL}/${NAME}) + + echo "### Building '${NAME}' from ${TAG} for ${URL}" git checkout ${TAG} - scripts/gen_site.sh ${BASEURL} + scripts/gen_site.sh ${URL} mv public ${TMP}/archive/${NAME} echo "- name: \"${NAME}\"" >> ${TMP}/archives.yml @@ -53,9 +56,11 @@ for rel in "${TOBUILD_JEKYLL[@]}" do NAME=$(echo $rel | cut -d : -f 1) TAG=$(echo $rel | cut -d : -f 2) - echo "### Building '$NAME' from $TAG" + URL=$(echo ${BASEURL}/${NAME}) + + echo "### Building '${NAME}' from ${TAG} for ${URL}" git checkout ${TAG} - echo "baseurl: /$NAME" > config_override.yml + echo "baseurl: ${URL}" > config_override.yml bundle install bundle exec jekyll build --config _config.yml,config_override.yml @@ -79,7 +84,7 @@ sed -i 's/archive_landing: false/archive_landing: true/g' data/args.yml cp ${TMP}/archives.yml data scripts/build_site.sh -scripts/gen_site.sh "https://archive.istio.io" +scripts/gen_site.sh "$1" mv public/* ${TMP}/archive rm -fr ${GITDIR} public