Skip to content

Commit 8afe8f9

Browse files
committed
perf: prefetch all top-level pages on load
1 parent 5ac3e7d commit 8afe8f9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/Header.astro

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const { focus } = Astro.props;
4040
class="inline-flex flex-shrink-0 items-center gap-0.5 hover:underline"
4141
rel={banner.link.startsWith("/") ? undefined : "noreferrer"}
4242
target={banner.link.startsWith("/") ? undefined : "_blank"}
43+
data-astro-prefetch="viewport"
4344
>
4445
{banner.linkText ?? "詳細はこちら"}
4546
<Icon name="feather:arrow-right" />
@@ -48,7 +49,7 @@ const { focus } = Astro.props;
4849
)
4950
}
5051
<div class="flex h-16">
51-
<a href="/" class="flex items-center px-4">
52+
<a href="/" class="flex items-center px-4" data-astro-prefetch="load">
5253
<Logo class="ml-8 w-36" variant="default" />
5354
</a>
5455
<div aria-hidden="true" class="flex-grow"></div>
@@ -87,7 +88,11 @@ const { focus } = Astro.props;
8788
{
8889
links.map((link) => (
8990
<li class="hover:brightness-75">
90-
<a href={link.to} class="block px-4 py-2">
91+
<a
92+
href={link.to}
93+
class="block px-4 py-2"
94+
data-astro-prefetch="load"
95+
>
9196
{link.title}
9297
</a>
9398
</li>

0 commit comments

Comments
 (0)