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