diff --git a/-scripts/copy-llms-files.sh b/-scripts/copy-llms-files.sh new file mode 100755 index 0000000000..30d55c3ca8 --- /dev/null +++ b/-scripts/copy-llms-files.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Copy llms.txt files to site root after Antora build +# This makes them accessible at /docs/llms.txt and /docs/llms-full.txt for AI/LLM discoverability + +set -e + +BUILD_DIR="${1:-build/site}" + +echo "Copying llms.txt files to $BUILD_DIR/..." + +find "$BUILD_DIR" -mindepth 2 \( -name "llms.txt" -o -name "llms-full.txt" \) \ + -exec cp {} "$BUILD_DIR/" \; \ + -print + +if [ ! -f "$BUILD_DIR/llms.txt" ] || [ ! -f "$BUILD_DIR/llms-full.txt" ]; then + echo "Error: one or both llms.txt files were not copied to $BUILD_DIR" + exit 1 +fi + +echo "Done." diff --git a/.github/workflows/deploy_docs_v2.yml b/.github/workflows/deploy_docs_v2.yml index 66b4fdd8e7..f3a3e3a9b5 100644 --- a/.github/workflows/deploy_docs_v2.yml +++ b/.github/workflows/deploy_docs_v2.yml @@ -50,6 +50,9 @@ jobs: - name: Build Website run: yarn antora ./antora-playbook.yml + - name: Copy llms.txt files to root + run: ./-scripts/copy-llms-files.sh build/site + - name: Rename site folder to docs run: | mv ./build/site ./build/docs diff --git a/.github/workflows/preview_create.yml b/.github/workflows/preview_create.yml index 03c3a7760e..eebc3a64c9 100644 --- a/.github/workflows/preview_create.yml +++ b/.github/workflows/preview_create.yml @@ -43,6 +43,9 @@ jobs: - name: Build Website run: yarn antora ./antora-playbook.yml + - name: Copy llms.txt files to root + run: ./-scripts/copy-llms-files.sh build/site + - name: Rename site folder to docs run: | mv ./build/site ./build/docs