From 6bd7c45dd6c477c2f288a26f9dddcaff6b14d73e Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Thu, 13 Aug 2026 20:24:43 -0700 Subject: migrate codebase to astro blog v7 --- src/pages/blog/[...slug].astro | 6 +++--- src/pages/blog/index.astro | 2 +- src/pages/index.astro | 4 ++-- src/pages/micro/[...slug].astro | 6 +++--- src/pages/micro/index.astro | 2 +- src/pages/rss.xml.js | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/pages') diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro index 12436c2..eb88f66 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -1,18 +1,18 @@ --- -import { CollectionEntry, getCollection } from 'astro:content'; +import { CollectionEntry, getCollection, render } from 'astro:content'; import BlogPost from '../../layouts/BlogPost.astro'; export async function getStaticPaths() { const posts = await getCollection('blog'); return posts.map((post) => ({ - params: { slug: post.slug }, + params: { slug: post.id }, props: post, })); } type Props = CollectionEntry<'blog'>; const post = Astro.props; -const { Content } = await post.render(); +const { Content } = await render(post); --- diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro index 11201b1..79034d4 100644 --- a/src/pages/blog/index.astro +++ b/src/pages/blog/index.astro @@ -42,7 +42,7 @@ const posts = (await getCollection('blog')).sort( posts.map((post) => (
  • - {post.data.title} + {post.data.title}
  • )) } diff --git a/src/pages/index.astro b/src/pages/index.astro index ec63ed6..1ef4af0 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -48,7 +48,7 @@ const microposts = (await getCollection("micro")).sort( .map((post) => (
  • - {post.data.title} + {post.data.title}
  • )) .reverse() @@ -64,7 +64,7 @@ const microposts = (await getCollection("micro")).sort( .map((post) => (
  • - {post.data.title} + {post.data.title}
  • )) .reverse() diff --git a/src/pages/micro/[...slug].astro b/src/pages/micro/[...slug].astro index 0ad6f8b..099d78f 100644 --- a/src/pages/micro/[...slug].astro +++ b/src/pages/micro/[...slug].astro @@ -1,18 +1,18 @@ --- -import { CollectionEntry, getCollection } from 'astro:content'; +import { CollectionEntry, getCollection, render } from 'astro:content'; import BlogPost from '../../layouts/BlogPost.astro'; export async function getStaticPaths() { const posts = await getCollection('micro'); return posts.map((post) => ({ - params: { slug: post.slug }, + params: { slug: post.id }, props: post, })); } type Props = CollectionEntry<'micro'>; const post = Astro.props; -const { Content } = await post.render(); +const { Content } = await render(post); --- diff --git a/src/pages/micro/index.astro b/src/pages/micro/index.astro index 7393216..1abc9df 100644 --- a/src/pages/micro/index.astro +++ b/src/pages/micro/index.astro @@ -42,7 +42,7 @@ const posts = (await getCollection('micro')).sort( posts.map((post) => (
  • - {post.data.title} + {post.data.title}
  • )) } diff --git a/src/pages/rss.xml.js b/src/pages/rss.xml.js index 83f4946..5c0c9bc 100644 --- a/src/pages/rss.xml.js +++ b/src/pages/rss.xml.js @@ -17,7 +17,7 @@ export async function GET(context) { site: context.site, items: posts.map((post) => ({ ...post.data, - link: `/${post.collection}/${post.slug}/`, + link: `/${post.collection}/${post.id}/`, })), }); } -- cgit v1.2.3