Skip to content

Commit 81fcf0c

Browse files
authored
Chore: Add Beta tag to the Chainhook Page title (#1112)
Adde Beta tag to the Chainhook Page title
1 parent 87f17a2 commit 81fcf0c

File tree

7 files changed

+30
-2
lines changed

7 files changed

+30
-2
lines changed

app/[locale]/[...slug]/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export default async function Page(props: {
117117
interactive: page.data.interactive,
118118
title: page.data.title,
119119
description: page.data.description,
120+
isBeta: page.data.isBeta,
120121
interactiveFeatures: page.data.interactiveFeatures,
121122
interactiveLinks, // Use the processed links with React components
122123
};
@@ -207,6 +208,11 @@ export default async function Page(props: {
207208
<div className="flex justify-between items-start gap-4">
208209
<div className="flex items-center gap-3">
209210
<DocsPageTitle className="mt-0" />
211+
{page.data.isBeta && (
212+
<span className="font-regular text-[10px] px-1 py-0.5 rounded uppercase bg-brand-orange dark:bg-brand-orange text-neutral-950 border-none">
213+
BETA
214+
</span>
215+
)}
210216
{page.data.isRpc && (
211217
<Badge
212218
variant="outline"

app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function RootLayout({ children }: { children: ReactNode }) {
1313
className={`${aeonik.variable} ${aeonikFono.variable} ${aeonikMono.variable} ${inter.variable}`}
1414
suppressHydrationWarning
1515
>
16-
<body className="flex flex-col min-h-screen">
16+
<body className="flex flex-col min-h-screen" suppressHydrationWarning>
1717
<QueryProvider>
1818
<ApiCredentialsProvider>
1919
<KeyboardShortcutsProvider>

components/layouts/docs.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ export function SidebarItem({ item, children }: { item: PageTree.Node; children:
304304
const sidebarTitle = (item as any).data?.sidebarTitle;
305305
const displayName = sidebarTitle || item.name;
306306
const isRootPage = (item as any).data?.root === true;
307+
// Hide badges for sidebar items that are folder index pages shown as children
308+
// These are duplicates - the folder itself already shows the badge
309+
const isFolderIndexAsChild = sidebarTitle === 'Overview';
307310

308311
return (
309312
<Link
@@ -324,7 +327,7 @@ export function SidebarItem({ item, children }: { item: PageTree.Node; children:
324327
<div className="!font-normal flex items-center gap-2 flex-1">
325328
{item.icon}
326329
{displayName}
327-
<PageBadges item={item} />
330+
{!isFolderIndexAsChild && <PageBadges item={item} />}
328331
</div>
329332
</Link>
330333
);
@@ -416,6 +419,7 @@ export function PageBadges({ item }: { item: PageTree.Node }) {
416419
const badges: React.ReactNode[] = [];
417420

418421
const isNew = (item as any).data?.isNew;
422+
const isBeta = (item as any).data?.isBeta;
419423

420424
if (isNew) {
421425
badges.push(
@@ -428,6 +432,17 @@ export function PageBadges({ item }: { item: PageTree.Node }) {
428432
);
429433
}
430434

435+
if (isBeta) {
436+
badges.push(
437+
<span
438+
key="beta"
439+
className="font-regular text-[10px] px-1 py-0.5 rounded uppercase bg-brand-orange dark:bg-brand-orange text-neutral-950 border-none"
440+
>
441+
Beta
442+
</span>,
443+
);
444+
}
445+
431446
const openapi = (item as any).data?.openapi;
432447
const operations = openapi?.operations || [];
433448

components/layouts/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export interface PageData {
2222
interactive?: boolean;
2323
title?: string;
2424
description?: string;
25+
isBeta?: boolean;
2526
interactiveFeatures?: string[];
2627
interactiveLinks?: Array<{
2728
title: string;

content/docs/en/tools/chainhooks/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Chainhooks
33
sidebarTitle: Overview
44
description: Chainhooks is a webhook service for the Stacks blockchain that lets you register event streams and define precise filters to capture on-chain data as it happens.
55
llm: false
6+
isBeta: true
67
---
78

89
:::callout

lib/source.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,10 @@ export const source = loader({
617617
dataToAdd.sidebarTitle = frontmatter.sidebarTitle;
618618
}
619619

620+
if (frontmatter?.isBeta) {
621+
dataToAdd.isBeta = frontmatter.isBeta;
622+
}
623+
620624
// if (frontmatter?.root) {
621625
// dataToAdd.root = frontmatter.root;
622626
// }

source.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const docs = defineDocs({
1010
schema: frontmatterSchema.extend({
1111
llm: z.boolean().optional(),
1212
isNew: z.boolean().optional(),
13+
isBeta: z.boolean().optional(),
1314
publishedAt: z.string().optional(),
1415
sidebarTitle: z.string().optional(),
1516
root: z.boolean().optional(),

0 commit comments

Comments
 (0)