From 22e353c04c1d15805be93e6922b45e9372415d8f Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 6 Jul 2026 21:53:18 -0400 Subject: update astro --- .gitignore | 1 + bun.lockb | Bin 303965 -> 256188 bytes package.json | 10 +++++----- src/content.config.ts | 18 ++++++++++++++++++ src/content/config.ts | 16 ---------------- src/pages/blog/[...slug].astro | 4 ++-- src/pages/blog/index.astro | 2 +- src/pages/index.astro | 2 +- 8 files changed, 28 insertions(+), 25 deletions(-) create mode 100644 src/content.config.ts delete mode 100644 src/content/config.ts diff --git a/.gitignore b/.gitignore index 7cd801f..24a2c45 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ pnpm-debug.log* .DS_Store .idea/ +.vercel diff --git a/bun.lockb b/bun.lockb index 474ba7f..c2bc450 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 12e3ad2..0bf7919 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,10 @@ "astro": "astro" }, "dependencies": { - "@astrojs/react": "4.4.2", - "@astrojs/rss": "4.0.15", - "@astrojs/svelte": "7.2.5", - "@astrojs/vercel": "9.0.4", + "@astrojs/react": "6.0.1", + "@astrojs/rss": "4.0.19", + "@astrojs/svelte": "9.0.1", + "@astrojs/vercel": "11.0.2", "@iconify-json/fa6-brands": "^1.2.6", "@iconify-json/fa6-solid": "^1.2.4", "@iconify-json/simple-icons": "^1.2.71", @@ -22,7 +22,7 @@ "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@types/three": "^0.180.0", - "astro": "5.18.0", + "astro": "7.0.6", "astro-icon": "^1.1.5", "dompurify": "^3.3.1", "markdown-it": "^14.1.1", diff --git a/src/content.config.ts b/src/content.config.ts new file mode 100644 index 0000000..4ba5c7c --- /dev/null +++ b/src/content.config.ts @@ -0,0 +1,18 @@ +import { defineCollection } from "astro:content"; +import { z } from 'astro/zod'; +import { glob } from 'astro/loaders'; +import { rssSchema } from '@astrojs/rss'; + +const blogCollection = defineCollection({ + loader: glob({ pattern: '**/[^_]*.{md,mdx}', base: "./src/content/blog" }), + schema: z.object({ + title: z.string(), + description: z.string(), + pubDate: z.date(), + tags: z.array(z.string()), + }), +}); + +export const collections = { + blog: blogCollection, +}; diff --git a/src/content/config.ts b/src/content/config.ts deleted file mode 100644 index 8dd2162..0000000 --- a/src/content/config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { defineCollection, z } from "astro:content"; -import { rssSchema } from '@astrojs/rss'; - -const blogCollection = defineCollection({ - type: 'content', - schema: z.object({ - title: z.string(), - description: z.string(), - pubDate: z.date(), - tags: z.array(z.string()), - }), -}); - -export const collections = { - blog: blogCollection, -}; diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro index 5f1b34a..6dc78ba 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -1,6 +1,6 @@ --- import Page from '../../layouts/BlogPost.astro'; -import { getEntry } from 'astro:content'; +import { getEntry, render } from 'astro:content'; import { formatDate } from "../../util"; const { slug } = Astro.params; @@ -14,7 +14,7 @@ if(entry === undefined) { return Astro.redirect('/404'); } -const { Content } = await entry.render(); +const { Content } = await render(entry); ---
diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro index a35537a..0e4e25e 100644 --- a/src/pages/blog/index.astro +++ b/src/pages/blog/index.astro @@ -23,7 +23,7 @@ const allBlogPosts = (await getCollection('blog')).sort((a, b) => b.data.pubDate
{allBlogPosts.map((post) => (
-

{post.data.title}

+

{post.data.title}

{formatDate(post.data.pubDate)}

{post.data.description}

diff --git a/src/pages/index.astro b/src/pages/index.astro index f1c2da9..943dc01 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -100,7 +100,7 @@ const allBlogPosts = (await getCollection('blog')).sort((a, b) => b.data.pubDate

Latest Posts

{allBlogPosts.map((post) => ( -- cgit v1.2.3