diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index ae90238..6617618 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -77,8 +77,19 @@ jobs: # Load existing versions.json from deployed site or create empty if [ -f "${{ github.workspace }}/docs/versions.json" ]; then - cp "${{ github.workspace }}/docs/versions.json" ./ - echo "✅ Loaded existing versions.json" + # If we're building a specific version, exclude it from the imported versions.json + if [ "${{ env.BUILDING_LATEST }}" != "true" ]; then + # Filter out the version we're about to build + node -e " + const versions = JSON.parse(require('fs').readFileSync('${{ github.workspace }}/docs/versions.json', 'utf8')); + const filtered = versions.filter(v => v !== '${{ env.VERSION_TAG }}'); + require('fs').writeFileSync('versions.json', JSON.stringify(filtered, null, 2)); + console.log('✅ Loaded versions.json (filtered out ${{ env.VERSION_TAG }})'); + " + else + cp "${{ github.workspace }}/docs/versions.json" ./ + echo "✅ Loaded existing versions.json" + fi else echo "[]" > versions.json echo "✅ Created empty versions.json" @@ -231,6 +242,16 @@ jobs: # Generate API docs for current build npm run gen-api-docs all + # Patch out duplicate version badges from OpenAPI MDX files + echo "🔧 Patching out duplicate version badges..." + find . -name "llama-stack-specification.info.mdx" -type f -exec sed -i '/$/d' {} \; + + # Also patch versioned files if they exist + if [ -d "versioned_docs" ]; then + find versioned_docs -name "llama-stack-specification.info.mdx" -type f -exec sed -i '/$/d' {} \; + fi + echo "✅ Version badge patching completed" + # Build the site npm run build diff --git a/versioned_docs/version-v0.2.23/api/llama-stack-specification.info.mdx b/versioned_docs/version-v0.2.23/api/llama-stack-specification.info.mdx index e979bcc..e8d97c2 100644 --- a/versioned_docs/version-v0.2.23/api/llama-stack-specification.info.mdx +++ b/versioned_docs/version-v0.2.23/api/llama-stack-specification.info.mdx @@ -14,11 +14,6 @@ import SchemaTabs from "@theme/SchemaTabs"; import TabItem from "@theme/TabItem"; import Export from "@theme/ApiExplorer/Export"; - -