Skip to content

Commit 54a3262

Browse files
authored
v0.7.58: styling improvements, files dimensions
2 parents 5dbb9a5 + 5dbe95e commit 54a3262

173 files changed

Lines changed: 20494 additions & 1147 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/docs/app/[lang]/[[...slug]]/page.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { notFound } from 'next/navigation'
1010
import { PageFooter } from '@/components/docs-layout/page-footer'
1111
import { PageNavigationArrows } from '@/components/docs-layout/page-navigation-arrows'
1212
import { LLMCopyButton } from '@/components/page-actions'
13-
import { PageTypeBadge } from '@/components/page-type-badge'
1413
import { StructuredData } from '@/components/structured-data'
1514
import { CodeBlock } from '@/components/ui/code-block'
1615
import { Heading } from '@/components/ui/heading'
@@ -23,6 +22,21 @@ import { DOCS_BASE_URL } from '@/lib/urls'
2322
const SUPPORTED_LANGUAGES: Set<string> = new Set(i18n.languages)
2423
const BASE_URL = DOCS_BASE_URL
2524

25+
/**
26+
* Most pages close with a `## Next` / `## Next steps` grid of onward links.
27+
* That heading is navigation, not content, so it is kept out of the table of
28+
* contents — the ToC should say what the page covers, not where to go after it.
29+
* The heading itself still renders above the cards.
30+
*
31+
* Matched on the slug rather than the rendered title because a ToC title is a
32+
* `ReactNode`; the trailing group tolerates the slugger's dedupe suffix.
33+
*/
34+
const ONWARD_NAV_SLUG = /^#next(-steps)?(-\d+)?$/i
35+
36+
function isContentHeading(item: { url: string }): boolean {
37+
return !ONWARD_NAV_SLUG.test(item.url)
38+
}
39+
2640
const OG_LOCALE_MAP: Record<string, string> = {
2741
en: 'en_US',
2842
es: 'es_ES',
@@ -171,7 +185,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
171185
breadcrumb={breadcrumbs}
172186
/>
173187
<DocsPage
174-
toc={data.toc}
188+
toc={data.toc.filter(isContentHeading)}
175189
breadcrumb={{
176190
enabled: false,
177191
}}
@@ -218,7 +232,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
218232
breadcrumb={breadcrumbs}
219233
/>
220234
<DocsPage
221-
toc={data.toc}
235+
toc={data.toc.filter(isContentHeading)}
222236
full={data.full || isAcademy}
223237
breadcrumb={{
224238
enabled: false,
@@ -244,7 +258,6 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
244258
</div>
245259
<PageNavigationArrows previous={neighbours?.previous} next={neighbours?.next} />
246260
</div>
247-
{data.pageType && <PageTypeBadge type={data.pageType} className='mb-3' />}
248261
<DocsTitle className='mb-2'>{data.title}</DocsTitle>
249262
</div>
250263
<DocsBody>

0 commit comments

Comments
 (0)