From fc0642256fb34e112c96d809dfa90c55665dff9e Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Fri, 20 Feb 2026 13:33:13 +1000 Subject: [PATCH 1/2] DOC-3373: Add new .sh script to copy to root post build. --- -scripts/copy-llms-files.sh | 36 ++++++++++++++++++++++++++++ .github/workflows/preview_create.yml | 3 +++ 2 files changed, 39 insertions(+) create mode 100755 -scripts/copy-llms-files.sh diff --git a/-scripts/copy-llms-files.sh b/-scripts/copy-llms-files.sh new file mode 100755 index 0000000000..5d67e600e8 --- /dev/null +++ b/-scripts/copy-llms-files.sh @@ -0,0 +1,36 @@ +#!/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}" + +if [ ! -d "$BUILD_DIR" ]; then + echo "Error: Build directory not found: $BUILD_DIR" + exit 1 +fi + +# Find the latest version directory (usually 'latest' or version number) +LATEST_DIR=$(find "$BUILD_DIR" -type d -path "*/tinymce/*/_attachments" -name "_attachments" | head -1 | xargs dirname) + +if [ -z "$LATEST_DIR" ]; then + echo "Error: Could not find _attachments directory in $BUILD_DIR" + exit 1 +fi + +ATTACHMENTS_DIR="$LATEST_DIR/_attachments" + +if [ ! -f "$ATTACHMENTS_DIR/llms.txt" ] || [ ! -f "$ATTACHMENTS_DIR/llms-full.txt" ]; then + echo "Error: llms.txt files not found in $ATTACHMENTS_DIR" + exit 1 +fi + +# Copy files to root +cp "$ATTACHMENTS_DIR/llms.txt" "$BUILD_DIR/llms.txt" +cp "$ATTACHMENTS_DIR/llms-full.txt" "$BUILD_DIR/llms-full.txt" + +echo "✓ Copied llms.txt files to $BUILD_DIR/" +echo " - $BUILD_DIR/llms.txt" +echo " - $BUILD_DIR/llms-full.txt" 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 From 6b91101945a27e21c1367e9c017e5ab5dfdb2fb2 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Mon, 23 Feb 2026 09:28:57 +1000 Subject: [PATCH 2/2] DOC-3373: Simplify .sh approach. --- -scripts/copy-llms-files.sh | 29 +++++++--------------------- .github/workflows/deploy_docs_v2.yml | 3 +++ 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/-scripts/copy-llms-files.sh b/-scripts/copy-llms-files.sh index 5d67e600e8..30d55c3ca8 100755 --- a/-scripts/copy-llms-files.sh +++ b/-scripts/copy-llms-files.sh @@ -7,30 +7,15 @@ set -e BUILD_DIR="${1:-build/site}" -if [ ! -d "$BUILD_DIR" ]; then - echo "Error: Build directory not found: $BUILD_DIR" - exit 1 -fi +echo "Copying llms.txt files to $BUILD_DIR/..." -# Find the latest version directory (usually 'latest' or version number) -LATEST_DIR=$(find "$BUILD_DIR" -type d -path "*/tinymce/*/_attachments" -name "_attachments" | head -1 | xargs dirname) +find "$BUILD_DIR" -mindepth 2 \( -name "llms.txt" -o -name "llms-full.txt" \) \ + -exec cp {} "$BUILD_DIR/" \; \ + -print -if [ -z "$LATEST_DIR" ]; then - echo "Error: Could not find _attachments directory in $BUILD_DIR" +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 -ATTACHMENTS_DIR="$LATEST_DIR/_attachments" - -if [ ! -f "$ATTACHMENTS_DIR/llms.txt" ] || [ ! -f "$ATTACHMENTS_DIR/llms-full.txt" ]; then - echo "Error: llms.txt files not found in $ATTACHMENTS_DIR" - exit 1 -fi - -# Copy files to root -cp "$ATTACHMENTS_DIR/llms.txt" "$BUILD_DIR/llms.txt" -cp "$ATTACHMENTS_DIR/llms-full.txt" "$BUILD_DIR/llms-full.txt" - -echo "✓ Copied llms.txt files to $BUILD_DIR/" -echo " - $BUILD_DIR/llms.txt" -echo " - $BUILD_DIR/llms-full.txt" +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