diff --git a/site/astro.config.mjs b/site/astro.config.mjs index 75d6a08f..151d82dd 100644 --- a/site/astro.config.mjs +++ b/site/astro.config.mjs @@ -28,7 +28,9 @@ export default defineConfig({ }, }), ], - prefetch: true, + prefetch: { + prefetchAll: true, + }, markdown: { // a lot of these are defaults but I'm setting them just to be explicit diff --git a/site/src/components/Footer.astro b/site/src/components/Footer.astro index 017c864b..b63dba83 100644 --- a/site/src/components/Footer.astro +++ b/site/src/components/Footer.astro @@ -9,12 +9,10 @@ type NavLink = { href: string; label: string; external?: boolean; - prefetch?: boolean; }; const navLinks: NavLink[] = [ { href: '/', label: 'Home' }, - // docs require a redirect, so, let's prefetch them to hide that latency - { href: '/docs', label: 'Docs', prefetch: true }, + { href: '/docs', label: 'Docs' }, // { href: '/blog', label: 'Blog' }, { href: '/privacy', label: 'Privacy' }, ]; @@ -31,11 +29,7 @@ const { class: className } = Astro.props;
{ navLinks.map((link) => ( - + {link.label} {link.external ? : null} )) diff --git a/site/src/components/NavBar/MobileNav.tsx b/site/src/components/NavBar/MobileNav.tsx index 7e94d0fc..08b9c022 100644 --- a/site/src/components/NavBar/MobileNav.tsx +++ b/site/src/components/NavBar/MobileNav.tsx @@ -1,9 +1,15 @@ -import type { NavLink } from './NavBar.astro'; import { Dialog } from '@base-ui-components/react/dialog'; import clsx from 'clsx'; import { ArrowUpRight, Menu, X } from 'lucide-react'; import { DISCORD_INVITE_URL, GITHUB_REPO_URL } from '@/consts'; +interface NavLink { + href: string; + label: string; + matchPath: string | null; + external?: boolean; +} + export interface MobileNavProps { navLinks: NavLink[]; currentPath: string; @@ -52,7 +58,6 @@ export default function MobileNav({ navLinks, currentPath, dark = false, childre href={link.href} className={clsx('text-lg px-6 py-3', link.matchPath && currentPath.startsWith(link.matchPath) ? 'underline' : 'intent:underline')} aria-current={link.matchPath && currentPath.startsWith(link.matchPath) ? 'page' : undefined} - data-astro-prefetch={link.prefetch ? '' : undefined} > {link.label} {' '} diff --git a/site/src/components/NavBar/NavBar.astro b/site/src/components/NavBar/NavBar.astro index b1763f2c..b457a76c 100644 --- a/site/src/components/NavBar/NavBar.astro +++ b/site/src/components/NavBar/NavBar.astro @@ -10,16 +10,14 @@ export interface Props { class?: string; } -export type NavLink = { +type NavLink = { href: string; label: string; matchPath: string | null; external?: boolean; - prefetch?: boolean; }; const navLinks: NavLink[] = [ - // docs require a redirect, so, let's prefetch them to hide that latency - { href: '/docs', label: 'Docs', matchPath: '/docs', prefetch: true }, + { href: '/docs', label: 'Docs', matchPath: '/docs' }, // { href: '/blog', label: 'Blog', matchPath: '/blog' }, ]; @@ -53,7 +51,6 @@ const { class: className, dark = false } = Astro.props; : 'border-transparent intent:border-current', ]} aria-current={link.matchPath && currentPath.startsWith(link.matchPath) ? 'page' : undefined} - data-astro-prefetch={link.prefetch ? '' : undefined} > {link.label} {link.external ? : null} diff --git a/site/src/components/docs/DocsLink.astro b/site/src/components/docs/DocsLink.astro index c20678b8..4bc73adb 100644 --- a/site/src/components/docs/DocsLink.astro +++ b/site/src/components/docs/DocsLink.astro @@ -24,6 +24,6 @@ const { url: href } = resolveDocsLinkUrl({ }); --- - +