aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xbun.lockbbin303965 -> 256188 bytes
-rw-r--r--package.json10
-rw-r--r--src/content.config.ts (renamed from src/content/config.ts)6
-rw-r--r--src/pages/blog/[...slug].astro4
-rw-r--r--src/pages/blog/index.astro2
-rw-r--r--src/pages/index.astro2
7 files changed, 14 insertions, 11 deletions
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
--- a/bun.lockb
+++ b/bun.lockb
Binary files 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
index 8dd2162..4ba5c7c 100644
--- a/src/content/config.ts
+++ b/src/content.config.ts
@@ -1,8 +1,10 @@
-import { defineCollection, z } from "astro:content";
+import { defineCollection } from "astro:content";
+import { z } from 'astro/zod';
+import { glob } from 'astro/loaders';
import { rssSchema } from '@astrojs/rss';
const blogCollection = defineCollection({
- type: 'content',
+ loader: glob({ pattern: '**/[^_]*.{md,mdx}', base: "./src/content/blog" }),
schema: z.object({
title: z.string(),
description: z.string(),
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);
---
<Page title={entry.data.title} description={entry.data.description} pubDate={formatDate(entry.data.pubDate)} tags={entry.data.tags}>
<main>
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
<div class="grid">
{allBlogPosts.map((post) => (
<article class="card">
- <h1><a href={`/blog/${post.slug}`}>{post.data.title}</a></h1>
+ <h1><a href={`/blog/${post.id}`}>{post.data.title}</a></h1>
<small>{formatDate(post.data.pubDate)}</small>
<p>{post.data.description}</p>
<div class="tags">
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
<h1>Latest Posts</h1>
{allBlogPosts.map((post) => (
<article>
- <h1 class="blog-title"><a href={`/blog/${post.slug}`}>{post.data.title}</a></h1>
+ <h1 class="blog-title"><a href={`/blog/${post.id}`}>{post.data.title}</a></h1>
<small>{formatDate(post.data.pubDate)}</small>
<p>{post.data.description}</p>
</article>