diff --git a/content/docs/meta.json b/content/docs/meta.json index 8e5f94f..c5d7b51 100644 --- a/content/docs/meta.json +++ b/content/docs/meta.json @@ -4,6 +4,7 @@ "root": true, "pages": [ "getting-started", + "guide", "deploy", "configure", "themes", diff --git a/content/docs/themes/index.mdx b/content/docs/themes/index.mdx index 0340e22..0e94d20 100644 --- a/content/docs/themes/index.mdx +++ b/content/docs/themes/index.mdx @@ -49,7 +49,7 @@ import { ThemeCard } from '@/components/theme-card'; /> ({ - lang: page.locale, slug: getPageImage(page).segments, })); } diff --git a/src/components/contributors.tsx b/src/components/contributors.tsx index 8d708ba..444300a 100644 --- a/src/components/contributors.tsx +++ b/src/components/contributors.tsx @@ -33,10 +33,14 @@ async function fetchContributors(): Promise<{ let page = 1; while (true) { try { + const headers: Record = { 'User-Agent': 'mx-docs' }; + if (process.env.GITHUB_TOKEN) { + headers.Authorization = `Bearer ${process.env.GITHUB_TOKEN}`; + } const res = await fetch( `https://api.github.com/repos/${repo}/contributors?per_page=100&page=${page}`, { - headers: { 'User-Agent': 'mx-docs' }, + headers, next: { revalidate: 86400 }, }, ); diff --git a/src/components/landing-hero.tsx b/src/components/landing-hero.tsx index fc0efd9..6ff6c41 100644 --- a/src/components/landing-hero.tsx +++ b/src/components/landing-hero.tsx @@ -41,7 +41,7 @@ export function LandingHero() { - Github + GitHub diff --git a/src/components/type-table.tsx b/src/components/type-table.tsx index 9a13f85..bfa8bf3 100644 --- a/src/components/type-table.tsx +++ b/src/components/type-table.tsx @@ -4,7 +4,7 @@ import { ChevronDown } from 'lucide-react'; import Link from 'fumadocs-core/link'; import { cva } from 'class-variance-authority'; import { cn } from '../lib/cn'; -import { type ComponentProps, type ReactNode, useState } from 'react'; +import { type ComponentProps, type ReactNode, useEffect, useState } from 'react'; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from './ui/collapsible'; export interface ParameterNode { @@ -94,10 +94,13 @@ function Item({ item: TypeNode; }) { const id = parentId ? `${parentId}-${name}` : undefined; - const [open, setOpen] = useState(() => { - if (!id || typeof window === 'undefined') return false; - return window.location.hash === `#${id}`; - }); + const [open, setOpen] = useState(false); + + useEffect(() => { + if (id && window.location.hash === `#${id}`) { + setOpen(true); + } + }, [id]); return ( ) { const [animate, setAnimate] = useState(false); - const mounted = useRef(false); useEffect(() => { - mounted.current = true; setAnimate(true); }, []);