1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-09-18 13:25:32 -04:00

experimental prefetching on hover for common links

This commit is contained in:
2025-04-15 09:30:20 -04:00
parent fe7076f495
commit cfe77f98d6
10 changed files with 50 additions and 37 deletions

View File

@@ -4,6 +4,7 @@ import CountUp from "../../../components/CountUp";
import redis from "../../../lib/redis";
const HitCounter = async ({ slug }: { slug: string }) => {
// ensure this component isn't triggered by prerenders and/or preloads
await connection();
try {

View File

@@ -125,7 +125,7 @@ const Page = async ({ params }: { params: Promise<{ slug: string }> }) => {
className={styles.metaItem}
style={{
// fix potential layout shift when number of hits loads
minWidth: "7em",
minWidth: "6em",
marginRight: 0,
}}
>

View File

@@ -40,7 +40,11 @@ const Page = async () => {
<li className={styles.post} key={slug}>
<Time date={date} format="MMM d" className={styles.date} />
<span>
<Link href={`/${POSTS_DIR}/${slug}`} dangerouslySetInnerHTML={{ __html: htmlTitle || title }} />
<Link
dynamicOnHover
href={`/${POSTS_DIR}/${slug}`}
dangerouslySetInnerHTML={{ __html: htmlTitle || title }}
/>
</span>
</li>
))}