Skip to content
Open
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
3 changes: 2 additions & 1 deletion .vitepress/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const navItemOrder: Record<string, string[]> = {
"develop-from-scratch",
],
sdk: ["quickstart", "cli", "services", "generator"],
reference: ["api", "platform", "concepts", "infrastructure"],
reference: ["api", "platform", "concepts", "infrastructure", "security", "changelog"],
"getting-started": ["quickstart", "core-concepts", "console"],
"app-shell": [
"introduction",
Expand Down Expand Up @@ -86,6 +86,7 @@ export const defaultSidebarOrder: string[] = ["overview", "quickstart"];
// Section-specific overrides (only if you need different ordering for a specific section)
export const sidebarItemOrder: Record<string, string[]> = {
function: ["overview", "builtin-interfaces"],
reference: ["api", "platform", "concepts", "infrastructure", "security", "changelog"],
"app-shell": [
"introduction",
"quickstart",
Expand Down
13 changes: 10 additions & 3 deletions .vitepress/config/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,23 @@ export function generateSidebar(
for (const dirName of sortedDirs) {
const subdirPath = path.join(dir, dirName);
const subdirBasePath = `${basePath}/${dirName}`;
const dirIndexPath = path.join(fullPath, dirName, "index.md");
const hasIndex = fs.existsSync(dirIndexPath);
const subItems = generateSidebar(docsDir, subdirPath, subdirBasePath, depth + 1);

// Add directory if it has sub-items OR if it has an index.md
if (subItems.length > 0) {
// Check if directory has an index.md to read title from
const dirIndexPath = path.join(fullPath, dirName, "index.md");
items.push({
text: toTitle(dirName, { filePath: fs.existsSync(dirIndexPath) ? dirIndexPath : undefined }),
text: toTitle(dirName, { filePath: hasIndex ? dirIndexPath : undefined }),
collapsed: depth > 0,
items: subItems,
});
} else if (hasIndex) {
// Directory with only index.md - add as direct link
items.push({
text: toTitle(dirName, { filePath: dirIndexPath }),
link: subdirBasePath,
});
}
}

Expand Down
Loading