diff --git a/site/Makefile b/site/Makefile index 3c014f222553..2d2584791ded 100755 --- a/site/Makefile +++ b/site/Makefile @@ -21,6 +21,10 @@ help: # Show help for each of the Makefile recipes. serve: # Clean, build, and run the docs site locally. dev/serve.sh +.PHONY: serve-local +serve-local: # Clean, build, and run the docs site locally using local docs. + dev/serve.sh --local + .PHONY: build build: # Clean and build the docs site locally. dev/build.sh diff --git a/site/dev/common.sh b/site/dev/common.sh index b106713b4c02..caf281acafb4 100755 --- a/site/dev/common.sh +++ b/site/dev/common.sh @@ -234,6 +234,21 @@ pull_versioned_docs () { create_nightly } +# Sets up local worktrees for the documentation and performs operations related to different versions. +pull_local_docs () { + echo " --> pull local docs (fast local mode)" + + mkdir -p docs/docs + mkdir -p docs/javadoc + + # Retrieve the latest version of documentation for processing + local latest_version=$(get_latest_version) + echo "Latest version is: ${latest_version}" + + # Only create the 'nightly' version in local mode, skip 'latest' for speed + create_nightly +} + # Cleans up artifacts and temporary files generated during documentation management. clean () { echo " --> clean" diff --git a/site/dev/serve.sh b/site/dev/serve.sh index 8901de92ab04..2d10359280a0 100755 --- a/site/dev/serve.sh +++ b/site/dev/serve.sh @@ -18,6 +18,6 @@ set -e -./dev/setup_env.sh +./dev/setup_env.sh "$1" mkdocs serve --dirty --watch . diff --git a/site/dev/setup_env.sh b/site/dev/setup_env.sh index f87c10d20d2e..991c04ef04af 100755 --- a/site/dev/setup_env.sh +++ b/site/dev/setup_env.sh @@ -24,6 +24,10 @@ clean install_deps -pull_versioned_docs +if [ "$1" == "--local" ]; then + pull_local_docs +else + pull_versioned_docs +fi git show "${REMOTE}/main:../.asf.yaml" > docs/.asf.yaml