The ServerlessLLM documentation now supports versioning with two documentation tracks:
- Stable versions (0.7.0, 0.8.0, etc.) - Released, tested documentation for production use
- Latest (dev) - Bleeding-edge documentation synced from the main branch
/docs/or/docs/intro→ 0.7.0 (stable) - Default for users/docs/latest/or/docs/latest/intro→ Latest (dev) - For developers/docs/0.7.0/→ Specific stable version/docs/api/→ API documentation (same for all versions)
Users can switch between versions using the dropdown in the navigation bar:
- 0.7.0 (stable) - Current stable release (default)
- Latest (dev) - Development documentation with unreleased features
- Older versions (0.6.0, 0.5.0, etc.) as they are added
serverlessllm.github.io/
├── docs/ # Latest (dev) - synced from main branch
│ ├── intro.md
│ ├── getting_started.md
│ ├── deployment/
│ ├── features/
│ ├── store/
│ ├── api/ # API docs (shared across versions)
│ └── ...
├── versioned_docs/ # Stable version snapshots
│ └── version-0.7.0/ # 0.7.0 stable release
│ ├── intro.md
│ ├── getting_started.md
│ └── ...
├── versioned_sidebars/ # Sidebar configs for each version
│ └── version-0.7.0-sidebars.json
└── versions.json # List of all versions: ["0.7.0"]
- Developer commits to
mainbranch in ServerlessLLM repository - Sync workflow triggers
- Documentation in
docs/folder is updated - Users accessing
/docs/latest/see the new content
- New release is published (e.g., v0.8.0)
- Version snapshot workflow triggers
- Creates
versioned_docs/version-0.8.0/with frozen documentation - Updates
versions.jsonto include 0.8.0 - Updates config to make 0.8.0 the new default
- Users accessing
/docs/now see 0.8.0 by default
Location: .github/workflows/sync-latest-docs.yml
Trigger: Repository dispatch event sync-latest-docs
Purpose: Updates the "Latest (dev)" documentation from main branch
Testing:
gh workflow run sync-latest-docs.ymlLocation: .github/workflows/create-version-snapshot.yml
Trigger: Repository dispatch event create-version-snapshot or manual dispatch
Purpose: Creates a versioned snapshot when a new release is published
Testing:
gh workflow run create-version-snapshot.yml \
-f version=0.8.0 \
-f tag=v0.8.0The main ServerlessLLM repository needs workflow files to trigger documentation syncing.
See .github/MAIN_REPO_WORKFLOWS.md for detailed instructions on:
- Setting up sync workflows in the main repo
- Creating GitHub tokens
- Configuring repository dispatch events
When releasing a new version (e.g., 0.8.0):
- Sync docs from the release tag:
# Clone the main repo at the specific tag
git clone --depth 1 --branch v0.8.0 https://github.com/ServerlessLLM/ServerlessLLM.git temp_repo
# Remove current docs (keep api/)
find docs/ -mindepth 1 -maxdepth 1 ! -name 'api' ! -name 'images' ! -name 'README.md' -exec rm -rf {} +
# Copy docs from release
cp -r temp_repo/docs/* docs/
# Clean up
rm -rf temp_repo- Create version snapshot:
npm run docusaurus docs:version 0.8.0- Update docusaurus.config.js:
docs: {
lastVersion: '0.8.0', // Update to new stable version
versions: {
current: {
label: 'Latest (dev)',
path: 'latest',
banner: 'unreleased',
},
'0.8.0': {
label: '0.8.0 (stable)',
path: '/',
banner: 'none',
},
'0.7.0': {
label: '0.7.0',
// Older version, no longer default
},
},
}- Commit and push:
git add .
git commit -m "docs: create version 0.8.0 snapshot"
git pushUse the create-version-snapshot.yml workflow:
# Trigger from main ServerlessLLM repo on release
# OR manually trigger from this repo:
gh workflow run create-version-snapshot.yml \
-f version=0.8.0 \
-f tag=v0.8.0Lists all stable versions:
[
"0.8.0",
"0.7.0",
"0.6.0"
]Configure version behavior:
docs: {
lastVersion: '0.8.0', // Default version for /docs/
versions: {
current: {
label: 'Latest (dev)', // Label in dropdown
path: 'latest', // URL path
banner: 'unreleased', // Warning banner
badge: true, // Show badge
},
'0.8.0': {
label: '0.8.0 (stable)',
path: '/', // Root path (default)
banner: 'none',
},
'0.7.0': {
label: '0.7.0',
// Uses default path: /docs/0.7.0/
},
},
}The migration from the old structure involved:
- ✅ Moved
docs/stable/*→docs/* - ✅ Updated
sidebars.jsto use root directory - ✅ Created initial version 0.7.0 snapshot
- ✅ Configured versioning in
docusaurus.config.js - ✅ Fixed broken internal links
- ✅ Updated homepage link
- ✅ Created sync workflows
Old URL structure:
/docs/stable/intro→ Documentation
New URL structure:
/docs/intro→ Stable documentation (0.7.0)/docs/latest/intro→ Latest development docs/docs/0.7.0/intro→ Specific version
Impact: External links to /docs/stable/* will break and need updating.
Set up redirects for old URLs:
// In docusaurus.config.js
plugins: [
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
{
from: '/docs/stable/:path',
to: '/docs/:path',
},
],
},
],
],Issue: Broken links after restructuring
Solution: Update all internal links:
../stable/path.md→../path.md- Ensure cross-references between
docs/anddocs/api/use correct relative paths
Issue: New version not visible
Solution:
- Check
versions.jsonincludes the version - Verify
versioned_docs/version-X.X.X/exists - Rebuild:
npm run build
Issue: Latest (dev) shows by default instead of stable
Solution: Ensure lastVersion in config points to stable version:
docs: {
lastVersion: '0.7.0', // Should be stable, not 'current'
}- Always sync from tagged releases for stable versions, not from branches
- Test versioned docs locally before deploying
- Update version labels in config when creating new versions
- Keep version history - don't delete old versions unless necessary
- Document breaking changes between versions in release notes
Potential improvements to consider:
- Automatic version creation on GitHub releases
- Version deprecation banners for outdated versions
- Version-specific search to filter results by version
- Changelog integration linking versions to release notes
- Version comparison tools to see changes between versions
For issues or questions about versioning:
- Check Docusaurus versioning docs: https://docusaurus.io/docs/versioning
- Report issues: https://github.com/ServerlessLLM/serverlessllm.github.io/issues