Skip to content

Commit 689edef

Browse files
committed
upgrade starlight-blog and prefetch
1 parent fc4e884 commit 689edef

File tree

4 files changed

+120
-38
lines changed

4 files changed

+120
-38
lines changed

astro.config.mjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import starlightBlog from 'starlight-blog'
44
import react from '@astrojs/react'
55
import tailwind from '@astrojs/tailwind'
66
import sitemap from '@astrojs/sitemap'
7-
import prefetch from '@astrojs/prefetch'
87

98
import robotsTxt from 'astro-robots-txt'
109
const description =
@@ -14,6 +13,10 @@ const ogImage = 'https://codegenie.codes/og.jpg'
1413
// https://astro.build/config
1514
export default defineConfig({
1615
site: 'https://codegenie.codes',
16+
prefetch: {
17+
prefetchAll: true,
18+
defaultStrategy: 'viewport'
19+
},
1720
integrations: [
1821
react(),
1922
tailwind(),
@@ -180,9 +183,6 @@ export default defineConfig({
180183
],
181184
}),
182185
sitemap(),
183-
prefetch({
184-
intentSelector: ["a[href^='/']", "a[href^='https://codegenie.codes']", "a[href^='https://www.codegenie.codes']"],
185-
}),
186186
robotsTxt(),
187187
],
188188
})

package-lock.json

+110-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"astro": "astro"
1212
},
1313
"dependencies": {
14-
"@astrojs/prefetch": "^0.4.1",
1514
"@astrojs/sitemap": "^3.1.6",
1615
"@astrojs/starlight": "^0.27.1",
1716
"@astrojs/tailwind": "^5.1.1",
@@ -22,7 +21,7 @@
2221
"framer-motion": "^11.0.6",
2322
"npm-check-updates": "^16.14.15",
2423
"sharp": "^0.33.2",
25-
"starlight-blog": "^0.5.0",
24+
"starlight-blog": "^0.12.0",
2625
"tailwindcss": "^3.4.1",
2726
"typescript": "^5.3.3"
2827
},

src/content/config.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
2-
import { defineCollection } from 'astro:content';
3-
import { blogSchema } from 'starlight-blog/schema';
1+
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema'
2+
import { defineCollection } from 'astro:content'
3+
import { blogSchema } from 'starlight-blog/schema'
44

55
export const collections = {
6-
docs: defineCollection({ schema: docsSchema({ extend: blogSchema() }) }),
7-
};
6+
docs: defineCollection({ schema: docsSchema({ extend: (context) => blogSchema(context) }) }),
7+
}

0 commit comments

Comments
 (0)