diff --git a/_data/pages/ambassadors.yml b/_data/pages/ambassadors.yml index 9c57a7816b..ba82b0db62 100644 --- a/_data/pages/ambassadors.yml +++ b/_data/pages/ambassadors.yml @@ -2,7 +2,7 @@ id: 5ecdf9cf-d433-478a-a280-07e0f860534f title: Ambassadors Program show_title: true template: narrow content -toc: false +hideToc: true parent_page: 683db5f6-c625-4fe0-a2af-3c5b6af8c2c9 breadcrumbs: true page_last_updated: true diff --git a/workspaces/cms-config/src/collections/pages.ts b/workspaces/cms-config/src/collections/pages.ts index 3e555db414..91b80eec67 100644 --- a/workspaces/cms-config/src/collections/pages.ts +++ b/workspaces/cms-config/src/collections/pages.ts @@ -60,11 +60,11 @@ export const pagesCollectionConfig = { default: "content", }, { - name: "toc", - label: "Show table of contents", + name: "hideToc", + label: "Hide table of content", hint: "Applies only for the 'content' template type", widget: "boolean", - default: true, + default: false, required: false }, { diff --git a/workspaces/cms-data/src/pages.ts b/workspaces/cms-data/src/pages.ts index 2dd60c14a1..a472ffbd88 100644 --- a/workspaces/cms-data/src/pages.ts +++ b/workspaces/cms-data/src/pages.ts @@ -218,7 +218,7 @@ export interface Page extends Meta { readonly link: string; readonly title: string; readonly show_title?: boolean; - readonly toc?: boolean; + readonly hideToc?: boolean; readonly template: "landing" | "content" | "narrow content"; readonly tocCustomTitle?: string; readonly breadcrumbs: boolean; diff --git a/workspaces/website/src/pages/(components)/CMSPage.tsx b/workspaces/website/src/pages/(components)/CMSPage.tsx index 48635175f4..929d01d151 100644 --- a/workspaces/website/src/pages/(components)/CMSPage.tsx +++ b/workspaces/website/src/pages/(components)/CMSPage.tsx @@ -101,7 +101,7 @@ export default function CMSPage({ } rightAside={ - data.template === "content" ? ( + data.template === "content" && !data.hideToc ? ( ) : null } diff --git a/workspaces/website/src/pages/(components)/TableOfContents/blocksToTOC.ts b/workspaces/website/src/pages/(components)/TableOfContents/blocksToTOC.ts index d6265d1d9a..32bb920ecb 100644 --- a/workspaces/website/src/pages/(components)/TableOfContents/blocksToTOC.ts +++ b/workspaces/website/src/pages/(components)/TableOfContents/blocksToTOC.ts @@ -33,6 +33,11 @@ export function blocksToTOC(blocks: readonly TopLevelBlock[] = [], level: number tableOfContents.push(headingData); blocksToTOC(block.blocks, level + 1, tableOfContents); } + } else if (block.type === 'video_section') { + tableOfContents.push({ + title: block["scaling-eth"].title, + level + }); } else if (block.type === "ordered_block") { const sortedBlocks = Array.from(block.blocks || []).sort((a, b) => { return a.title.localeCompare(b.title);