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
19 changes: 18 additions & 1 deletion _components/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,22 @@ function getSectionData(data: Lume.Data, currentUrl: string) {

// Fall back to the default behavior using just the first segment
const dataPath = urlSegments[0];
return data.search.data(`/${dataPath}/`)?.sidebar;
const sectionData = data.search.data(`/${dataPath}/`);

// If the section has multi-sidebar routing (e.g. runtime), pick the right one
const sidebarUrlMap = sectionData?.sidebarUrlMap as
| Record<string, string>
| undefined;
const sidebars = sectionData?.sidebars as
| Record<string, unknown[]>
| undefined;
if (sidebarUrlMap && sidebars) {
const normalizedUrl = currentUrl.replace(/\/$/, "");
const tabHref = sidebarUrlMap[normalizedUrl];
if (tabHref && sidebars[tabHref]) {
return sidebars[tabHref];
}
}

return sectionData?.sidebar;
}
6 changes: 3 additions & 3 deletions _components/SidebarNav/comp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ function SidebarItem(props: {
isActive?: boolean;
}) {
const defaultClasses =
"block m-0 py-1 px-3 border-l hover:bg-header-highlight hover:border-foreground-secondary hover:text-gray-800 transition-colors duration-150";
"block m-0 py-1 px-3 hover:bg-header-highlight hover:text-gray-800 transition-colors duration-150";
const activeClasses = props.isActive
? "bg-header-highlight border-foreground-secondary text-gray-800"
: "border-foreground-tertiary";
? "bg-header-highlight text-gray-800"
: "";

const combinedClasses = `${defaultClasses} ${activeClasses}`;

Expand Down
10 changes: 10 additions & 0 deletions _components/SubNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ export default function (

const urlNoQuery = currentUrl.split("?")[0].split("#")[0];

// If the section provides a URL→tab mapping (e.g. runtime), use it
const sidebarUrlMap = data.page?.data?.sidebarUrlMap as
| Record<string, string>
| undefined;
if (sidebarUrlMap) {
const tabHref = sidebarUrlMap[urlNoQuery.replace(/\/$/, "")];
if (tabHref) return tabHref;
}

// Otherwise fall back to longest URL prefix match
const isSegmentPrefix = (href: string, url: string): boolean => {
if (!url.startsWith(href)) return false;
if (url.length === href.length) return true; // exact match
Expand Down
2 changes: 1 addition & 1 deletion _includes/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function Layout(data: Lume.Data) {
data.url.startsWith("/subhosting") ||
data.url.startsWith("/services") ||
data.url.startsWith("/sandbox");
const hasSubNav = isServicesPage;
const hasSubNav = isServicesPage || data.url.startsWith("/runtime");

return (
<html lang="en">
Expand Down
6 changes: 3 additions & 3 deletions reference/_components/ReferenceSidebarNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ function SidebarItem(props: {
isActive?: boolean;
}) {
const defaultClasses =
"block m-0 py-1 px-3 border-l hover:bg-header-highlight hover:border-foreground-secondary hover:text-gray-800 transition-colors duration-150";
"block m-0 py-1 px-3 hover:bg-header-highlight hover:text-gray-800 transition-colors duration-150";
const activeClasses = props.isActive
? "bg-header-highlight border-foreground-secondary text-gray-800"
: "border-foreground-tertiary";
? "bg-header-highlight text-gray-800"
: "";

const combinedClasses = `${defaultClasses} ${activeClasses}`;

Expand Down
2 changes: 1 addition & 1 deletion reference_gen/parallel-doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ async function runOptimizedDocGeneration() {
Deno.exit(1);
} else {
console.log(
`\n🎉 Documentation generation completed successfully in <green>${totalTime}s<green`,
`\n🎉 Documentation generation completed successfully in <green>${totalTime}s</green>`,
);
console.log(`📊 Tasks: ${tasksRun} run, ${tasksSkipped} skipped`);
}
Expand Down
Loading
Loading