Files
paseo/packages/website/src/components/alternative-page.tsx
T
Mohamed BoudraandGitHub 7e46f6a647 Rework docs navigation and move alternatives to top-level pages (#1487)
* Rework docs navigation and move alternatives to top-level pages

- Add nested docs nav with categories, collapsible groups, breadcrumbs,
  and a right-hand page outline with heading slugs.
- Move alternatives out of /docs/alternatives into /alternatives/*
  marketing pages with 301 redirects.
- Add github-slugger for heading IDs and require explicit width on
  SiteShell so new pages can't accidentally pick the narrow prose layout.
- Remove the best-practices doc from public-docs.

* Make docs content column prose-width
2026-06-12 12:53:30 +00:00

39 lines
969 B
TypeScript

import { DocsMarkdown } from "~/components/docs-markdown";
import { SiteShell } from "~/components/site-shell";
import { getAlternativePage } from "~/data/alternative-pages";
import { pageMeta } from "~/meta";
export function alternativeRouteOptions(slug: string) {
const page = getAlternativePage(slug);
return {
head: () =>
pageMeta(
page?.title ?? "Alternative - Paseo",
page?.description ?? "",
`/alternatives/${slug}`,
),
component: function AlternativePageRoute() {
return <AlternativePageContent slug={slug} />;
},
};
}
function AlternativePageContent({ slug }: { slug: string }) {
const page = getAlternativePage(slug);
if (!page) {
return (
<SiteShell width="default">
<p className="text-muted-foreground">Page not found.</p>
</SiteShell>
);
}
return (
<SiteShell width="default">
<DocsMarkdown>{page.content}</DocsMarkdown>
</SiteShell>
);
}