Skip to content

Commit 0406e2a

Browse files
authored
Merge pull request #24 from devwqc/develop
[release] develop to main
2 parents 2e6aaec + 62185f6 commit 0406e2a

7 files changed

Lines changed: 120 additions & 14 deletions

File tree

package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22
"name": "devwqc-blog",
33
"type": "module",
44
"version": "0.0.1",
5+
"description": "devwqc-blog",
6+
"author": "devwqc <devwqc@gmail.com>",
7+
"keywords": [
8+
"astro",
9+
"blog"
10+
],
11+
"license": "MIT",
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/devwqc/devwqc.github.io"
15+
},
16+
"homepage": "https://devwqc.github.io/",
17+
"bugs": {
18+
"url": "https://github.com/devwqc/devwqc.github.io/issues",
19+
"email": "devwqc@gmail.com"
20+
},
521
"scripts": {
622
"dev": "astro dev",
723
"start": "astro dev",

src/components/FormattedDate.astro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ type Props = Omit<HTMLAttributes<'time'>, 'datetime'> & {
66
};
77
88
const { datetime, ...props } = Astro.props;
9-
const formattedDate = datetime.toISOString().split('T')[0];
9+
const formattedDate = datetime.toLocaleDateString('ko-KR', {
10+
year: 'numeric',
11+
month: '2-digit',
12+
day: '2-digit',
13+
});
1014
---
1115

1216
<time datetime={formattedDate} {...props}>{formattedDate}</time>

src/components/Markdown.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
33
---
44

5-
<div class="prose pt-10">
5+
<div class="prose py-10">
66
<slot />
77
</div>

src/pages/about.astro

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,24 @@ import PageLayout from '@/layouts/PageLayout.astro';
33
---
44

55
<PageLayout title="About">
6-
<h1>About</h1>
6+
<article class="flex flex-col gap-10">
7+
<header>
8+
<h1 class="text-3xl font-bold py-3">정봉찬</h1>
9+
<p class="text-xl">프론트엔드 개발자</p>
10+
</header>
11+
<section>
12+
<h2 class="text-2xl py-2">교육</h2>
13+
<ul>
14+
<li>
15+
<p>
16+
코드잇 스프린트 (프론트엔드 부트캠프) <span class="text-slate-500">
17+
<time datetime="2023.12">2023.12</time> ~ <time datetime="2024.06"
18+
>2024.06</time
19+
>
20+
</span>
21+
</p>
22+
</li>
23+
</ul>
24+
</section>
25+
</article>
726
</PageLayout>

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

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,29 @@ const { Content } = await post.render();
2121

2222
<PageLayout title={post.data.title}>
2323
<article>
24-
<header class="border-b pb-10 text-center">
25-
<h1 class="text-3xl font-bold">{post.data.title}</h1>
26-
<FormattedDate datetime={post.data.publishedDate} class="text-gray-500" />
24+
<header class="border-b pb-10 text-center flex flex-col gap-3">
25+
<h1 class="text-4xl font-bold">{post.data.title}</h1>
26+
<p class="text-gray-500">
27+
<span>
28+
작성일:
29+
<FormattedDate datetime={post.data.publishedDate} />
30+
</span>
31+
{
32+
post.data.updatedDate && (
33+
<span>
34+
수정일:
35+
<FormattedDate datetime={post.data.updatedDate} />
36+
</span>
37+
)
38+
}
39+
</p>
2740
</header>
2841
<MarkDown>
2942
<Content />
3043
</MarkDown>
44+
<footer>
45+
<p>방문해 주셔서 감사합니다.</p>
46+
<p>오탈자, 잘못된 정보에 대해 말씀해 주시면 감사히 받겠습니다.</p>
47+
</footer>
3148
</article>
3249
</PageLayout>

src/pages/blog/index.astro

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
import FormattedDate from '@/components/FormattedDate.astro';
23
import PageLayout from '@/layouts/PageLayout.astro';
34
import { getCollection } from 'astro:content';
45
@@ -11,13 +12,28 @@ const posts = (await getCollection('blog')).sort(
1112
<ul>
1213
{
1314
posts.map((post) => (
14-
<li>
15-
<a
16-
href={`/blog/${post.slug}/`}
17-
class="hover:text-emerald-600 text-3xl"
18-
>
19-
{post.data.title}
20-
</a>
15+
<li class="py-5">
16+
<article>
17+
<a
18+
href={`/blog/${post.slug}/`}
19+
class="hover:text-emerald-600 flex flex-col gap-1"
20+
>
21+
<h2 class="text-3xl font-bold">{post.data.title}</h2>
22+
<p class="text-gray-500 text-sm">
23+
<span>
24+
작성일:
25+
<FormattedDate datetime={post.data.publishedDate} />
26+
</span>
27+
{post.data.updatedDate && (
28+
<span>
29+
수정일:
30+
<FormattedDate datetime={post.data.updatedDate} />
31+
</span>
32+
)}
33+
</p>
34+
<p class="text-slate-500">{post.data.description}</p>
35+
</a>
36+
</article>
2137
</li>
2238
))
2339
}

src/pages/index.astro

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,41 @@
11
---
2+
import FormattedDate from '@/components/FormattedDate.astro';
23
import PageLayout from '@/layouts/PageLayout.astro';
4+
import { getCollection } from 'astro:content';
5+
6+
const posts = (await getCollection('blog')).sort(
7+
(a, b) => b.data.publishedDate.valueOf() - a.data.publishedDate.valueOf()
8+
);
39
---
410

511
<PageLayout title="Home">
6-
<h1>Home</h1>
12+
<ul>
13+
{
14+
posts.map((post) => (
15+
<li class="py-5">
16+
<article>
17+
<a
18+
href={`/blog/${post.slug}/`}
19+
class="hover:text-emerald-600 flex flex-col gap-1"
20+
>
21+
<h2 class="text-3xl font-bold">{post.data.title}</h2>
22+
<p class="text-gray-500 text-sm">
23+
<span>
24+
작성일:
25+
<FormattedDate datetime={post.data.publishedDate} />
26+
</span>
27+
{post.data.updatedDate && (
28+
<span>
29+
수정일:
30+
<FormattedDate datetime={post.data.updatedDate} />
31+
</span>
32+
)}
33+
</p>
34+
<p class="text-slate-500">{post.data.description}</p>
35+
</a>
36+
</article>
37+
</li>
38+
))
39+
}
40+
</ul>
741
</PageLayout>

0 commit comments

Comments
 (0)