Skip to content

Commit 7354895

Browse files
committed
Refactoring (rename posts to lessons)
1 parent 4cd7d09 commit 7354895

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/pages/lessons/index.astro

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import FormattedDate from '../../components/FormattedDate.astro';
77
import Header from '../../components/Header.astro';
88
import { SITE_DESCRIPTION, SITE_TITLE } from '../../consts';
99
10-
const posts = (await getCollection('lessons')).sort(
10+
const lessons = (await getCollection('lessons')).sort(
1111
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(),
1212
);
1313
---
@@ -92,15 +92,15 @@ const posts = (await getCollection('lessons')).sort(
9292
<section>
9393
<ul>
9494
{
95-
posts.map((post) => (
95+
lessons.map((lesson) => (
9696
<li>
97-
<a href={`/lessons/${post.id}/`}>
98-
{post.data.heroImage && (
99-
<Image width={720} height={360} src={post.data.heroImage} alt="" />
97+
<a href={`/lessons/${lesson.id}/`}>
98+
{lesson.data.heroImage && (
99+
<Image width={720} height={360} src={lesson.data.heroImage} alt="" />
100100
)}
101-
<h4 class="title">{post.data.title}</h4>
101+
<h4 class="title">{lesson.data.title}</h4>
102102
<p class="date">
103-
<FormattedDate date={post.data.pubDate} />
103+
<FormattedDate date={lesson.data.pubDate} />
104104
</p>
105105
</a>
106106
</li>

0 commit comments

Comments
 (0)