Skip to content

Commit 11baf83

Browse files
committed
feat: make speedy
1 parent a813ca6 commit 11baf83

File tree

5 files changed

+22
-3
lines changed

5 files changed

+22
-3
lines changed

astro.config.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { defineConfig } from 'astro/config';
22
import tailwind from '@astrojs/tailwind';
33
import image from '@astrojs/image';
4-
54
import react from "@astrojs/react";
65

6+
import prefetch from "@astrojs/prefetch";
7+
78
// https://astro.build/config
89
export default defineConfig({
910
integrations: [tailwind(), image({
1011
serviceEntryPoint: '@astrojs/image/sharp'
11-
}), react()]
12+
}), react(), prefetch()]
1213
});

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"dependencies": {
1313
"@astrojs/image": "^0.16.8",
14+
"@astrojs/prefetch": "0.2.1",
1415
"@astrojs/react": "^2.1.3",
1516
"@astrojs/tailwind": "^3.1.2",
1617
"@types/react": "^18.0.21",

pnpm-lock.yaml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Layout.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ const { title } = Astro.props;
2020
width={128}
2121
height={128}
2222
/>
23-
<a class="pl-2 font-mono text-3xl font-bold" href="/">Rustular</a>
23+
<a rel="prefetch" class="pl-2 font-mono text-3xl font-bold" href="/"
24+
>Rustular</a
25+
>
2426
</header>
2527
<slot />
2628
</body>

src/pages/index.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import Layout from '../components/Layout.astro';
1616
</div>
1717
<div class="mx-auto flex space-x-8">
1818
<a
19+
rel="prefetch"
1920
class="rounded-full border-2 border-white bg-white px-8 py-4 text-fuchsia-600 hover:border-slate-200 hover:bg-slate-200"
2021
href="/docs"
2122
>

0 commit comments

Comments
 (0)