Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 '/<span$/,/<\/span>$/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 '/<span$/,/<\/span>$/d' {} \;
fi
echo "✅ Version badge patching completed"

# Build the site
npm run build

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ import SchemaTabs from "@theme/SchemaTabs";
import TabItem from "@theme/TabItem";
import Export from "@theme/ApiExplorer/Export";

<span
className={"theme-doc-version-badge badge badge--secondary"}
children={"Version: v1"}
>
</span>

<Export
url={"https://raw.githubusercontent.com/meta-llama/llama-stack/main/docs/static/llama-stack-spec.yaml"}
Expand Down