File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727 },
2828 "dependencies" : {
2929 "@astrojs/check" : " ^0.9.3" ,
30+ "@astrojs/rss" : " 4.0.7" ,
3031 "@astrojs/tailwind" : " 5.1.1" ,
3132 "astro" : " ^4.15.9" ,
3233 "tailwindcss" : " 3.4.13" ,
Original file line number Diff line number Diff line change @@ -28,5 +28,10 @@ const today = new Date();
2828 rel =" noreferrer noopener" >LinkedIn</SnsIcon
2929 >
3030 </li >
31+ <li >
32+ <SnsIcon href =" /rss.xml" target =" _blank" rel =" noreferrer noopener"
33+ >RSS</SnsIcon
34+ >
35+ </li >
3136 </ul >
3237</footer >
Original file line number Diff line number Diff line change 1+ ---
2+
3+ ---
4+
5+ <section class =" giscus mx-auto w-full" ></section >
6+
7+ <script
8+ src =" https://giscus.app/client.js"
9+ data-repo =" devwqc/devwqc.github.io"
10+ data-repo-id =" R_kgDOM5MFPQ"
11+ data-category =" Blog Posts Comments"
12+ data-category-id =" DIC_kwDOM5MFPc4Ci-uX"
13+ data-mapping =" url"
14+ data-strict =" 0"
15+ data-reactions-enabled =" 1"
16+ data-emit-metadata =" 0"
17+ data-input-position =" bottom"
18+ data-theme =" light"
19+ data-lang =" ko"
20+ crossorigin =" anonymous"
21+ async ></script >
Original file line number Diff line number Diff line change 11---
22title : ' Hello World!'
33description : ' Hello World!'
4- publishedDate : ' 2024-10-01'
4+ pubDate : ' 2024-10-01'
55---
66
77## Hello World!를 작성하는 시점의 나
Original file line number Diff line number Diff 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} ) ;
Original file line number Diff line number Diff line change 11---
22import FormattedDate from ' @/components/FormattedDate.astro' ;
33import MarkDown from ' @/components/Markdown.astro' ;
4+ import PostComments from ' @/components/PostComments.astro' ;
45import PageLayout from ' @/layouts/PageLayout.astro' ;
56import { getCollection , type CollectionEntry } from ' astro:content' ;
67
@@ -26,7 +27,7 @@ const { Content } = await post.render();
2627 <p class =" text-gray-500" >
2728 <span >
2829 작성일:
29- <FormattedDate datetime ={ post .data .publishedDate } />
30+ <FormattedDate datetime ={ post .data .pubDate } />
3031 </span >
3132 {
3233 post .data .updatedDate && (
@@ -41,9 +42,11 @@ const { Content } = await post.render();
4142 <MarkDown >
4243 <Content />
4344 </MarkDown >
44- <footer >
45+ <footer class =" pb-10" >
46+ <p >Issue on GitHub</p >
4547 <p >방문해 주셔서 감사합니다.</p >
4648 <p >오탈자, 잘못된 정보에 대해 말씀해 주시면 감사히 받겠습니다.</p >
4749 </footer >
50+ <PostComments />
4851 </article >
4952</PageLayout >
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import PageLayout from '@/layouts/PageLayout.astro';
44import { getCollection } from ' astro:content' ;
55
66const 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 >
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import PageLayout from '@/layouts/PageLayout.astro';
44import { getCollection } from ' astro:content' ;
55
66const 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 >
Original file line number Diff line number Diff line change 1+ import rss from '@astrojs/rss' ;
2+ import type { APIContext } from 'astro' ;
3+ import { getCollection } from 'astro:content' ;
4+
5+ export async function GET ( context : APIContext ) {
6+ const posts = ( await getCollection ( 'blog' ) ) . sort (
7+ ( a , b ) => b . data . pubDate . valueOf ( ) - a . data . pubDate . valueOf ( )
8+ ) ;
9+ return rss ( {
10+ title : 'devwqc blog' ,
11+ description : '저의 경험을 이야기하는 블로그입니다.' ,
12+ site : context . site || 'https://devwqc.github.io/' ,
13+ items : posts . map ( ( post ) => ( {
14+ ...post . data ,
15+ link : `/blog/${ post . slug } /` ,
16+ } ) ) ,
17+ } ) ;
18+ }
You can’t perform that action at this time.
0 commit comments