mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-06-05 20:35:29 -04:00
fix: disable prefetching for links across multiple components to improve performance
This commit is contained in:
+6
-1
@@ -32,6 +32,7 @@ const PostStats = ({ views, comments, slug }: { views: number; comments: number;
|
||||
{comments > 0 && (
|
||||
<Link
|
||||
href={`/${POSTS_DIR}/${slug}#comments`}
|
||||
prefetch={false}
|
||||
title={`${numberFormatter.format(comments)} ${comments === 1 ? "comment" : "comments"}`}
|
||||
className="inline-flex hover:no-underline"
|
||||
>
|
||||
@@ -109,7 +110,11 @@ const PostsList = async () => {
|
||||
</span>
|
||||
<div className="space-x-2.5">
|
||||
{/* htmlTitle is sanitized by rehypeSanitize in lib/posts.ts with strict allowlist: only code, em, strong tags */}
|
||||
<Link href={`/${POSTS_DIR}/${slug}`} dangerouslySetInnerHTML={{ __html: htmlTitle || title }} />
|
||||
<Link
|
||||
href={`/${POSTS_DIR}/${slug}`}
|
||||
prefetch={false}
|
||||
dangerouslySetInnerHTML={{ __html: htmlTitle || title }}
|
||||
/>
|
||||
|
||||
<PostStats slug={slug} views={views} comments={comments} />
|
||||
</div>
|
||||
|
||||
+10
-1
@@ -93,6 +93,7 @@ const Page = () => {
|
||||
I fell in love with{" "}
|
||||
<Link
|
||||
href="/previously"
|
||||
prefetch={false}
|
||||
title="My Terrible, Horrible, No Good, Very Bad First Websites"
|
||||
className="[--primary:#4169e1] dark:[--primary:#8ca9ff]"
|
||||
>
|
||||
@@ -101,6 +102,7 @@ const Page = () => {
|
||||
and{" "}
|
||||
<Link
|
||||
href="/notes/my-first-code"
|
||||
prefetch={false}
|
||||
title="Jake's Bulletin Board, circa 2003"
|
||||
className="[--primary:#9932cc] dark:[--primary:#d588fb]"
|
||||
>
|
||||
@@ -109,6 +111,7 @@ const Page = () => {
|
||||
when my only source of income was{" "}
|
||||
<Link
|
||||
href="/birthday"
|
||||
prefetch={false}
|
||||
title="🎉 Cranky Birthday Boy on VHS Tape 📼"
|
||||
className="[--primary:#e40088] dark:[--primary:#fd40b1]"
|
||||
style={{
|
||||
@@ -132,6 +135,7 @@ const Page = () => {
|
||||
, an AI-powered bedtime story generator. Over the years, some of my other side projects{" "}
|
||||
<Link
|
||||
href="/leo"
|
||||
prefetch={false}
|
||||
title="Powncer segment on The Lab with Leo Laporte (G4techTV)"
|
||||
className="[--primary:#ff1b1b] dark:[--primary:#f06060]"
|
||||
>
|
||||
@@ -196,7 +200,12 @@ const Page = () => {
|
||||
LinkedIn
|
||||
</Link>
|
||||
. I’m always available to connect over{" "}
|
||||
<Link href="/contact" title="Send an email" className="[--primary:#de0c0c] dark:[--primary:#ff5050]">
|
||||
<Link
|
||||
href="/contact"
|
||||
prefetch={false}
|
||||
title="Send an email"
|
||||
className="[--primary:#de0c0c] dark:[--primary:#ff5050]"
|
||||
>
|
||||
email
|
||||
</Link>{" "}
|
||||
<sup className="mr-0.5 text-[0.6rem]">
|
||||
|
||||
@@ -13,11 +13,16 @@ const Footer = ({ className, ...rest }: React.ComponentProps<"footer">) => {
|
||||
>
|
||||
<div>
|
||||
Content{" "}
|
||||
<Link href="/license" className="text-foreground/85 hover:no-underline">
|
||||
<Link href="/license" prefetch={false} className="text-foreground/85 hover:no-underline">
|
||||
licensed under {siteConfig.license}
|
||||
</Link>
|
||||
,{" "}
|
||||
<Link href="/previously" title="Previously on..." className="text-foreground/85 hover:no-underline">
|
||||
<Link
|
||||
href="/previously"
|
||||
prefetch={false}
|
||||
title="Previously on..."
|
||||
className="text-foreground/85 hover:no-underline"
|
||||
>
|
||||
{siteConfig.copyrightYearStart}
|
||||
</Link>{" "}
|
||||
– 2025.
|
||||
|
||||
@@ -32,6 +32,7 @@ const MenuItem = ({
|
||||
return (
|
||||
<Link
|
||||
href={href}
|
||||
prefetch={false}
|
||||
aria-label={text}
|
||||
data-current={current || undefined}
|
||||
className="text-foreground/85 hover:border-b-ring/80 data-current:border-b-primary/60 inline-flex items-center hover:no-underline"
|
||||
|
||||
Reference in New Issue
Block a user