Skip to content

Commit

Permalink
Migrate other collections
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Dec 9, 2024
1 parent 7a588e9 commit 989962c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/Testimonials.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function Testimonials({ testimonials }) {
<StyledDiv>
<blockquote>{current.data.preview}</blockquote>
<figcaption>{current.data.author}</figcaption>
<a className={"btn btn-cyan"} href={`/testimonials/${current.slug}`}>
<a className={"btn btn-cyan"} href={`/testimonials/${current.id}`}>
<BookIcon />
Read more!
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blog.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const blogEntries = await getCollection("blog");
.map((blogEntry) => {
const { title, author, date } = blogEntry.data;
return (
<a href={`/blog/${blogEntry.slug}`}>
<a href={`/blog/${blogEntry.id}`}>
<h2>{title}</h2>
<h3>
<TimeAgo client:only="react" date={date} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
import { getCollection } from "astro:content";
import { getCollection, render } from "astro:content";
import PageLayout from "../../layouts/PageLayout.astro";
export async function getStaticPaths() {
const blogs = await getCollection("blog");
const colors = ["magenta", "cyan", "yellow"];
return blogs.map((entry, idx) => ({
params: { slug: entry.slug },
params: { id: entry.id },
props: { entry, color: colors[idx % colors.length] },
}));
}
const { entry, color } = Astro.props;
const { Content } = await entry.render();
const { Content } = await render(entry);
const { title, date, author, profilePicture } = entry.data;
const authorData = { picture: profilePicture, name: author };
Expand Down
2 changes: 1 addition & 1 deletion src/pages/sessions.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const sessions = await getCollection("sessions").then((sessions) => {
title: session.data.title,
date: session.data.date,
champion: session.data.champion,
slug: session.slug,
slug: session.id,
};
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { getCollection } from "astro:content";
import { getCollection, render } from "astro:content";
import PageLayout from "../../layouts/PageLayout.astro";
import LocalTime from "../../components/LocalTime.jsx";
import YouTubeVideo from "../../components/YouTubeVideo.astro";
Expand All @@ -9,13 +9,13 @@ export async function getStaticPaths() {
const colors = ["magenta", "yellow", "cyan"];
return sessionEntries.map((entry, idx) => ({
params: { slug: entry.slug },
params: { id: entry.id },
props: { entry, color: colors[idx % colors.length] },
}));
}
const { entry, color } = Astro.props;
const { Content } = await entry.render();
const { Content } = await render(entry);
const {
title,
company,
Expand Down

0 comments on commit 989962c

Please sign in to comment.