From 8afd44ff49a8b73786921700facfbfbc2f7ae7e6 Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Thu, 24 Oct 2024 00:39:17 +0200 Subject: [PATCH] prefetch sites on hovering their links in navbar --- astro.config.mjs | 6 ++++-- src/components/Nav.astro | 8 ++++---- src/pages/blog/index.astro | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 945ef7b..11af7c0 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,5 +1,4 @@ import { defineConfig } from 'astro/config' -import svelte from '@astrojs/svelte' import mdx from '@astrojs/mdx' import remarkGfm from 'remark-gfm' import remarkSmartypants from 'remark-smartypants' @@ -8,7 +7,10 @@ import rehypeExternalLinks from 'rehype-external-links' // https://astro.build/config export default defineConfig({ site: 'https://youhavetrouble.me', - integrations: [mdx(), svelte()], + prefetch: { + defaultStrategy: 'hover', + }, + integrations: [mdx()], markdown: { shikiConfig: { theme: 'nord', diff --git a/src/components/Nav.astro b/src/components/Nav.astro index c05ee78..5ebf323 100644 --- a/src/components/Nav.astro +++ b/src/components/Nav.astro @@ -75,9 +75,9 @@ const { current = '' } = Astro.props; diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro index 0a5e8f0..1b2281a 100644 --- a/src/pages/blog/index.astro +++ b/src/pages/blog/index.astro @@ -21,7 +21,7 @@ const allPosts= posts.sort((a, b) => new Date(b.data.publishDate).valueOf() - ne { index !== 0 &&
}

- {post.data.title} + {post.data.title}

{post.data.tags.map(item => (