diff options
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/blog/[...slug].astro | 6 | ||||
| -rw-r--r-- | src/pages/blog/index.astro | 2 | ||||
| -rw-r--r-- | src/pages/index.astro | 4 | ||||
| -rw-r--r-- | src/pages/micro/[...slug].astro | 6 | ||||
| -rw-r--r-- | src/pages/micro/index.astro | 2 | ||||
| -rw-r--r-- | src/pages/rss.xml.js | 2 |
6 files changed, 11 insertions, 11 deletions
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); --- <BlogPost {...post.data}> 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) => ( <li> <FormattedDate date={post.data.pubDate} /> - <a href={`/blog/${post.slug}/`}>{post.data.title}</a> + <a href={`/blog/${post.id}/`}>{post.data.title}</a> </li> )) } 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) => ( <li> <FormattedDate date={post.data.pubDate} /> - <a href={`/blog/${post.slug}/`}>{post.data.title}</a> + <a href={`/blog/${post.id}/`}>{post.data.title}</a> </li> )) .reverse() @@ -64,7 +64,7 @@ const microposts = (await getCollection("micro")).sort( .map((post) => ( <li> <FormattedDate date={post.data.pubDate} /> - <a href={`/micro/${post.slug}/`}>{post.data.title}</a> + <a href={`/micro/${post.id}/`}>{post.data.title}</a> </li> )) .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); --- <BlogPost {...post.data}> 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) => ( <li> <FormattedDate date={post.data.pubDate} /> - <a href={`/micro/${post.slug}/`}>{post.data.title}</a> + <a href={`/micro/${post.id}/`}>{post.data.title}</a> </li> )) } 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}/`, })), }); } |
