Standard.site landing page built in Next.js

Use native anchor tags for non-docs nav links

aka.dad 1b2ecf35 5d5a24d9

verified
+25 -16
+1 -1
app/components/MobileNav.tsx
··· 88 88 <div 89 89 className={ `p-4 relative flex flex-col gap-6 z-40 mx-auto max-w-[38rem] w-full min-h-0 overflow-hidden rounded-2xl transition-all duration-300 ease-in-out ${ 90 90 isOpen 91 - ? 'bg-zinc-950 dark:bg-zinc-50 text-zinc-50 dark:text-zinc-950 h-[34rem]' 91 + ? 'bg-zinc-950 dark:bg-zinc-50 text-zinc-50 dark:text-zinc-950 h-[31rem]' 92 92 : 'text-base-content h-15' 93 93 }` }> 94 94 <div className="flex justify-between items-center">
+22 -13
app/components/docs/DocsNav.tsx
··· 78 78 {section.title} 79 79 </span> 80 80 <div className="flex flex-col gap-2"> 81 - {section.items.map((item) => ( 82 - <Link 83 - key={item.href} 84 - href={item.href} 85 - className={`font-medium text-lg tracking-tight ${ 86 - pathname === item.href 87 - ? 'text-zinc-50 dark:text-zinc-950' 88 - : 'text-muted-content' 89 - } hover:text-zinc-50 dark:hover:text-zinc-950 transition-colors`} 90 - > 91 - {item.label} 92 - </Link> 93 - ))} 81 + {section.items.map((item) => { 82 + const isDocPage = item.href.startsWith('/docs/') 83 + const className = `font-medium text-lg tracking-tight ${ 84 + pathname === item.href 85 + ? 'text-zinc-50 dark:text-zinc-950' 86 + : 'text-muted-content' 87 + } hover:text-zinc-50 dark:hover:text-zinc-950 transition-colors` 88 + 89 + if (!isDocPage) { 90 + return ( 91 + <a key={item.href} href={item.href} className={className}> 92 + {item.label} 93 + </a> 94 + ) 95 + } 96 + 97 + return ( 98 + <Link key={item.href} href={item.href} className={className}> 99 + {item.label} 100 + </Link> 101 + ) 102 + })} 94 103 </div> 95 104 </div> 96 105 ))}
+2 -2
app/data/docs-nav.ts
··· 43 43 44 44 DOCS_NAV.forEach((section) => { 45 45 section.items.forEach((item) => { 46 - if (!item.href.startsWith('/docs/')) return 46 + if (item.href.includes('llms.txt')) return 47 47 const slug = item.href.replace('/docs/', '').split('/') 48 48 slugs.push(slug) 49 49 }) 50 50 }) 51 51 52 52 return slugs 53 - } 53 + }