Support new sidebar title page option

This commit is contained in:
Claire Chabas
2025-10-17 19:04:28 +02:00
parent c35d0e8954
commit 69732c6339
2 changed files with 5 additions and 2 deletions
@@ -10,6 +10,7 @@ import { ToggleableLinkItem } from './ToggleableLinkItem';
export function PageDocumentItem(props: { page: ClientTOCPageDocument }) {
const { page } = props;
const title = page.sidebarTitle || page.title;
return (
<li className="flex flex-col">
@@ -41,10 +42,10 @@ export function PageDocumentItem(props: { page: ClientTOCPageDocument }) {
{page.emoji || page.icon ? (
<span className="flex items-center gap-3">
<TOCPageIcon page={page} />
{page.title}
{title}
</span>
) : (
page.title
title
)}
</ToggleableLinkItem>
</li>
@@ -19,6 +19,7 @@ export type ClientTOCPageDocument = {
type: 'document';
id: string;
title: string;
sidebarTitle?: string;
href: string;
emoji?: string;
icon?: string;
@@ -73,6 +74,7 @@ export async function encodeClientTableOfContents(
removeUndefined({
id: page.id,
title: page.title,
sidebarTitle: page.sidebarTitle,
href,
emoji: page.emoji,
icon: page.icon,