mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-10-02 12:54:03 +00:00
Breadcrumbs on every page, and a sidebar that unfolds to where you are (#170)
Anthony: "this needs a cookie crumb navbar, all pages need this with the new IA" and "broad and drill down, I'm not seeing that in the sidebar". lib/crumbs.ts derives the trail from the path and the spec registry, so no page declares it: /openthreat is Home > Specs > Catalogs a site serves about itself > OpenThreat, /opencpu adds OpenServer before OpenCPU, /docs/openthreat ends in Specification, /docs/cli is Home > Docs > CLI, a blog post passes its title as the leaf. components/breadcrumbs.tsx renders it (server-rendered, with a BreadcrumbList JSON-LD) at the top of every SiteShell page; the SPA routes rendered by page-markup.ts get the same trail as a string. components/side-nav.tsx replaces the flat sidebar: the four groups stay, and under Specs the family the current page belongs to unfolds to its specs, and the spec to its blocks, marked active. The home page string marks the active entry for the SPA routes too. Claude-Session: https://claude.ai/code/session_014cmNRtR2vL1p89dbVQ7FZJ Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
eee9ce09c5
commit
df57b54bde
9 changed files with 310 additions and 32 deletions
|
|
@ -5,6 +5,7 @@
|
|||
// the `home-interactivity` client component.
|
||||
import { renderInstallCommand } from "./install-command";
|
||||
import { renderNavHtml } from "./nav";
|
||||
import { renderCrumbsHtml } from "./crumbs";
|
||||
import { FAMILIES, familyTree } from "./specs";
|
||||
|
||||
const schemas = [
|
||||
|
|
@ -110,7 +111,7 @@ const comparisonRows = [
|
|||
}
|
||||
];
|
||||
|
||||
export function renderPageMarkup(): string {
|
||||
export function renderPageMarkup(path = "/"): string {
|
||||
return `
|
||||
<main class="shell">
|
||||
<aside class="rail">
|
||||
|
|
@ -122,9 +123,10 @@ export function renderPageMarkup(): string {
|
|||
</div>
|
||||
</div>
|
||||
${renderInstallCommand("rail")}
|
||||
<nav aria-label="LogicSRC sections">${renderNavHtml("/")}</nav>
|
||||
<nav aria-label="LogicSRC sections">${renderNavHtml(path)}</nav>
|
||||
</aside>
|
||||
<section class="workspace">
|
||||
${renderCrumbsHtml(path)}
|
||||
<header id="overview" class="hero">
|
||||
<div>
|
||||
<p class="eyebrow">Profullstack open spec project</p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue