Skip to content

Commit 2028479

Browse files
authored
Merge pull request #27 from devwqc/refactor/blog-schema
[refactor] RSS feed를 위한 md frontmatter 프로퍼티 변경
2 parents 62185f6 + 1a71e2f commit 2028479

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/content/blog/2024/10/hello-world.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: 'Hello World!'
33
description: 'Hello World!'
4-
publishedDate: '2024-10-01'
4+
pubDate: '2024-10-01'
55
---
66

77
## Hello World!를 작성하는 시점의 나

src/content/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const blogCollection = defineCollection({
55
schema: z.object({
66
title: z.string(),
77
description: z.string(),
8-
publishedDate: z.coerce.date(),
8+
pubDate: z.coerce.date(),
99
updatedDate: z.coerce.date().optional(),
1010
}),
1111
});

src/pages/blog/[...slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const { Content } = await post.render();
2626
<p class="text-gray-500">
2727
<span>
2828
작성일:
29-
<FormattedDate datetime={post.data.publishedDate} />
29+
<FormattedDate datetime={post.data.pubDate} />
3030
</span>
3131
{
3232
post.data.updatedDate && (

src/pages/blog/index.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import PageLayout from '@/layouts/PageLayout.astro';
44
import { getCollection } from 'astro:content';
55
66
const posts = (await getCollection('blog')).sort(
7-
(a, b) => b.data.publishedDate.valueOf() - a.data.publishedDate.valueOf()
7+
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
88
);
99
---
1010

@@ -22,7 +22,7 @@ const posts = (await getCollection('blog')).sort(
2222
<p class="text-gray-500 text-sm">
2323
<span>
2424
작성일:
25-
<FormattedDate datetime={post.data.publishedDate} />
25+
<FormattedDate datetime={post.data.pubDate} />
2626
</span>
2727
{post.data.updatedDate && (
2828
<span>

src/pages/index.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import PageLayout from '@/layouts/PageLayout.astro';
44
import { getCollection } from 'astro:content';
55
66
const posts = (await getCollection('blog')).sort(
7-
(a, b) => b.data.publishedDate.valueOf() - a.data.publishedDate.valueOf()
7+
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
88
);
99
---
1010

@@ -22,7 +22,7 @@ const posts = (await getCollection('blog')).sort(
2222
<p class="text-gray-500 text-sm">
2323
<span>
2424
작성일:
25-
<FormattedDate datetime={post.data.publishedDate} />
25+
<FormattedDate datetime={post.data.pubDate} />
2626
</span>
2727
{post.data.updatedDate && (
2828
<span>

0 commit comments

Comments
 (0)