mirror of
https://github.com/imfing/hextra.git
synced 2025-09-14 04:40:20 -04:00
chore(docs): rename exampleSite
to docs
and create examples
(#813)
* chore(docs): rename `exampleSite` to `docs` and create `examples` * chore(build): update build script to support new version format and source directories; add v0.10 to documentation menu
This commit is contained in:
15
build.sh
15
build.sh
@@ -7,12 +7,13 @@ BASE_URL=${1:-"http://localhost:1313"}
|
||||
echo "Using base URL: $BASE_URL"
|
||||
|
||||
# Version configuration - modify these arrays to specify versions to build
|
||||
# Format: "ref:display_name" (ref can be tag, branch, or commit hash, display name is what will appear in URL)
|
||||
# MAIN_VERSION format: "ref:display_name"
|
||||
# VERSIONS format: "ref:display_name:source_dir" where source_dir is either "docs" or "exampleSite"
|
||||
MAIN_VERSION="v0.11.0:latest"
|
||||
VERSIONS=(
|
||||
"main:latest" # latest version always builds from main
|
||||
"v0.9.6:v0.9"
|
||||
"v0.8.6:v0.8"
|
||||
"main:latest:docs" # latest version always builds from main
|
||||
"v0.10.2:v0.10:docs"
|
||||
"v0.9.6:v0.9:exampleSite"
|
||||
)
|
||||
|
||||
# Parse main version
|
||||
@@ -29,13 +30,13 @@ GIT_HASH=$(git rev-parse --short HEAD)
|
||||
echo "Building main site from $MAIN_REF (commit: $GIT_HASH)"
|
||||
hugo \
|
||||
--minify \
|
||||
--themesDir=../.. --source=exampleSite \
|
||||
--themesDir=../.. --source=docs \
|
||||
--baseURL "$BASE_URL/" \
|
||||
--destination=../public
|
||||
|
||||
# Build all versions
|
||||
for VERSION in "${VERSIONS[@]}"; do
|
||||
IFS=':' read -r REF NAME <<< "$VERSION"
|
||||
IFS=':' read -r REF NAME DIR <<< "$VERSION"
|
||||
|
||||
git checkout $REF
|
||||
GIT_HASH=$(git rev-parse --short HEAD)
|
||||
@@ -44,7 +45,7 @@ for VERSION in "${VERSIONS[@]}"; do
|
||||
mkdir -p "public/versions/$NAME"
|
||||
hugo \
|
||||
--minify \
|
||||
--themesDir=../.. --source=exampleSite \
|
||||
--themesDir=../.. --source=$DIR \
|
||||
--baseURL "$BASE_URL/versions/$NAME/" \
|
||||
--destination="../public/versions/$NAME"
|
||||
done
|
||||
|
Reference in New Issue
Block a user