Files
hextra/build.sh
Xin 089c2fb5e1 chore: release blog for Hextra v0.12
* chore: release blog for Hextra v0.12

* Add v0.12 blog translations and proofreading updates

* Merge main into plan-release-v0.12.0 and update build script versions

* Update build environment versions in netlify.toml to HUGO 0.156.0, GO 1.26.0, and NODE 24.13.1

* chore: update banner messages in multiple languages to reflect the release of Hextra **v0.12** in hugo.yaml

* docs(blog): align v0.12 tabs example with image (Photos/Music/Videos)

* docs(blog): fix page context menu wording (dropdown, not right-click)

* docs(hugo): update version link from v0.9 to v0.11 in menu
2026-02-20 23:08:33 +00:00

57 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
set -e
# Specify the base URL
BASE_URL=${1:-"http://localhost:1313"}
echo "Using base URL: $BASE_URL"
# Version configuration - modify these arrays to specify versions to build
# MAIN_VERSION format: "ref:display_name:source_dir"
# VERSIONS format: "ref:display_name:source_dir" where source_dir is either "docs" or "exampleSite"
MAIN_VERSION="v0.11.3:latest:docs"
VERSIONS=(
"main:latest:docs" # latest version always builds from main
"v0.11.3:v0.11:docs"
"v0.10.3:v0.10:exampleSite"
)
# Parse main version
IFS=':' read -r MAIN_REF MAIN_NAME MAIN_DIR <<< "$MAIN_VERSION"
# Ensure clean public directory
rm -rf public
mkdir -p public
mkdir -p public/versions
# Checkout and build main site
git checkout $MAIN_REF
GIT_HASH=$(git rev-parse --short HEAD)
echo "Building main site from $MAIN_REF (commit: $GIT_HASH)"
hugo \
--minify \
--themesDir=../.. --source=$MAIN_DIR \
--baseURL "$BASE_URL/" \
--destination=../public
# Build all versions
for VERSION in "${VERSIONS[@]}"; do
IFS=':' read -r REF NAME DIR <<< "$VERSION"
git checkout $REF
GIT_HASH=$(git rev-parse --short HEAD)
echo "Building version $NAME from $REF (commit: $GIT_HASH)"
mkdir -p "public/versions/$NAME"
hugo \
--minify \
--themesDir=../.. --source=$DIR \
--baseURL "$BASE_URL/versions/$NAME/" \
--destination="../public/versions/$NAME"
done
# Return to main branch
git checkout main
echo "Build completed"