mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 01:53:26 +00:00
Support new sidebar title page option
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user