Skip to content

Commit 989962c

Browse files
committed
Migrate other collections
1 parent 7a588e9 commit 989962c

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/components/Testimonials.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function Testimonials({ testimonials }) {
150150
<StyledDiv>
151151
<blockquote>{current.data.preview}</blockquote>
152152
<figcaption>{current.data.author}</figcaption>
153-
<a className={"btn btn-cyan"} href={`/testimonials/${current.slug}`}>
153+
<a className={"btn btn-cyan"} href={`/testimonials/${current.id}`}>
154154
<BookIcon />
155155
Read more!
156156
</a>

src/pages/blog.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const blogEntries = await getCollection("blog");
1313
.map((blogEntry) => {
1414
const { title, author, date } = blogEntry.data;
1515
return (
16-
<a href={`/blog/${blogEntry.slug}`}>
16+
<a href={`/blog/${blogEntry.id}`}>
1717
<h2>{title}</h2>
1818
<h3>
1919
<TimeAgo client:only="react" date={date} />

src/pages/blog/[...slug].astro renamed to src/pages/blog/[...id].astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
2-
import { getCollection } from "astro:content";
2+
import { getCollection, render } from "astro:content";
33
import PageLayout from "../../layouts/PageLayout.astro";
44
55
export async function getStaticPaths() {
66
const blogs = await getCollection("blog");
77
const colors = ["magenta", "cyan", "yellow"];
88
99
return blogs.map((entry, idx) => ({
10-
params: { slug: entry.slug },
10+
params: { id: entry.id },
1111
props: { entry, color: colors[idx % colors.length] },
1212
}));
1313
}
1414
1515
const { entry, color } = Astro.props;
16-
const { Content } = await entry.render();
16+
const { Content } = await render(entry);
1717
const { title, date, author, profilePicture } = entry.data;
1818
const authorData = { picture: profilePicture, name: author };
1919

src/pages/sessions.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const sessions = await getCollection("sessions").then((sessions) => {
1212
title: session.data.title,
1313
date: session.data.date,
1414
champion: session.data.champion,
15-
slug: session.slug,
15+
slug: session.id,
1616
};
1717
});
1818
});

src/pages/sessions/[...slug].astro renamed to src/pages/sessions/[...id].astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { getCollection } from "astro:content";
2+
import { getCollection, render } from "astro:content";
33
import PageLayout from "../../layouts/PageLayout.astro";
44
import LocalTime from "../../components/LocalTime.jsx";
55
import YouTubeVideo from "../../components/YouTubeVideo.astro";
@@ -9,13 +9,13 @@ export async function getStaticPaths() {
99
const colors = ["magenta", "yellow", "cyan"];
1010
1111
return sessionEntries.map((entry, idx) => ({
12-
params: { slug: entry.slug },
12+
params: { id: entry.id },
1313
props: { entry, color: colors[idx % colors.length] },
1414
}));
1515
}
1616
1717
const { entry, color } = Astro.props;
18-
const { Content } = await entry.render();
18+
const { Content } = await render(entry);
1919
const {
2020
title,
2121
company,

0 commit comments

Comments
 (0)