From 562ce3e412a0a79a76fe5e9a28de17172803ee59 Mon Sep 17 00:00:00 2001 From: Jan Beinke Date: Fri, 1 Mar 2024 03:56:12 +0100 Subject: [PATCH] Improve performance of the page by enabling prefetchig and moving script tag to the body --- astro.config.ts | 3 ++ src/layouts/BaseLayout.astro | 69 ++++++++++++++++++------------------ 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/astro.config.ts b/astro.config.ts index 5327b2b5..902ffcb2 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -28,6 +28,9 @@ function rehypeExternalLinksPlugin() { // https://astro.build/config export default defineConfig({ + prefetch: { + prefetchAll: true, + }, integrations: [mdx(), tailwind(), compress()], markdown: { remarkPlugins: [setDefaultLayout], diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index c7adf505..a3f7be32 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -22,45 +22,44 @@ import ThemeToggle from '@components/ThemeToggle.astro' KoMa - {title} - - - +