-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from devwqc/develop
[release] develop to main
- Loading branch information
Showing
5 changed files
with
54 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
export const menu = [ | ||
export const menu: { | ||
path: string; | ||
label: string; | ||
includes: string[]; | ||
}[] = [ | ||
{ | ||
path: '/blog', | ||
label: 'Blog', | ||
includes: ['/', '/blog'], | ||
}, | ||
{ | ||
path: '/about', | ||
label: 'About', | ||
includes: ['/about'], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,41 @@ | ||
--- | ||
import FormattedDate from '@/components/FormattedDate.astro'; | ||
import PageLayout from '@/layouts/PageLayout.astro'; | ||
import { getCollection } from 'astro:content'; | ||
return Astro.redirect('/blog'); | ||
const posts = (await getCollection('blog')).sort( | ||
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf() | ||
); | ||
--- | ||
|
||
<PageLayout title="Home" /> | ||
<PageLayout title="Home"> | ||
<ul> | ||
{ | ||
posts.map((post) => ( | ||
<li class="py-5"> | ||
<article> | ||
<a | ||
href={`/blog/${post.slug}/`} | ||
class="hover:text-emerald-600 flex flex-col gap-1" | ||
> | ||
<h2 class="text-3xl font-bold">{post.data.title}</h2> | ||
<p class="text-gray-500 text-sm"> | ||
<span> | ||
작성일: | ||
<FormattedDate datetime={post.data.pubDate} /> | ||
</span> | ||
{post.data.updatedDate && ( | ||
<span> | ||
수정일: | ||
<FormattedDate datetime={post.data.updatedDate} /> | ||
</span> | ||
)} | ||
</p> | ||
<p class="text-slate-500">{post.data.description}</p> | ||
</a> | ||
</article> | ||
</li> | ||
)) | ||
} | ||
</ul> | ||
</PageLayout> |