-
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.
- Loading branch information
Showing
7 changed files
with
204 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
interface Props { | ||
date: Date; | ||
} | ||
const { date } = Astro.props; | ||
--- | ||
|
||
<time datetime={date?.toISOString()}> | ||
{ | ||
date?.toLocaleDateString('ko', { | ||
year: 'numeric', | ||
month: 'numeric', | ||
day: 'numeric', | ||
}) | ||
} | ||
</time> |
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
import { type CollectionEntry, getCollection } from "astro:content"; | ||
import FormattedDate from "./FormattedDate.astro"; | ||
export type StarlightDocsEntry = Omit<CollectionEntry<"docs">, "slug"> & { | ||
slug: string; | ||
}; | ||
const docs: StarlightDocsEntry[] = ((await getCollection("docs")) ?? []) | ||
.filter((d) => d.data.lastUpdated) | ||
.sort((a, b) => b.data.lastUpdated - a.data.lastUpdated) | ||
.slice(0, 7); | ||
console.log(docs); | ||
const getParentFolder = (fullPath) => fullPath.split("/").reverse()[1]; | ||
--- | ||
|
||
<> | ||
<div class="mt-[75px]"> | ||
<span>최신글</span> | ||
<div class="line"></div> | ||
<div class="flex flex-col gap-3"> | ||
{ | ||
docs.map((post) => { | ||
let content = post.body | ||
.replace(/>\s|#|-|import.*?;|<[^>]*>?/g, "") | ||
.slice(0, 200) | ||
.replace(/\`\`\`/g, "") | ||
.replace(/https:\/\/\S+/g, "") | ||
.replace(/\[([^\]]+)\]\([^\)]+\)/g, "$1"); | ||
|
||
function convertToCodeTag(content: string) { | ||
const regex = /\`([^\`]+)\`/g; | ||
const parts = []; | ||
let lastIndex = 0; | ||
content.replace(regex, (match, p1, offset) => { | ||
parts.push(content.slice(lastIndex, offset)); | ||
parts.push(<code>{p1}</code>); | ||
lastIndex = offset + match.length; | ||
}); | ||
parts.push(content.slice(lastIndex)); | ||
return parts; | ||
} | ||
return ( | ||
<div> | ||
<a class="no-underline" href={`/${post.slug}/`}> | ||
<div class="flex flex-row gap-2"> | ||
<span class="text-lg title font-bold">{post.data.title}</span> | ||
<div | ||
style="background-color: var(--sl-color-gray-4)" | ||
class="w-[1px] h-[20px] my-auto" | ||
/> | ||
<span style="color: var(--sl-color-gray-3)"> | ||
{getParentFolder(post.slug)}{" "} | ||
</span> | ||
</div> | ||
<FormattedDate date={post.data.lastUpdated} /> | ||
<span class="line-clamp-2 overflow-hidden bg-blue m-0 btext-ellipsis"> | ||
{convertToCodeTag(content)} | ||
</span> | ||
</a> | ||
</div> | ||
); | ||
}) | ||
} | ||
</div> | ||
</div> | ||
</> | ||
|
||
<style> | ||
.line { | ||
margin-top: 0.5rem; | ||
height: 0.07rem; | ||
background: var(--sl-color-gray-3); | ||
} | ||
</style> |
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,9 +1,30 @@ | ||
--- | ||
title: 김은빈 | ||
description: Get started building your docs site with Starlight. | ||
description: 글이나 코드를 읽고 짜는 걸 좋아합니다. 글과 코드를 쓸 때는 무엇을 어떻게 표현할지 끊임없이 고민해야 하고, 완성도를 높이기 위해 많은 공부가 필요합니다. 글과 코드를 읽을 때에도 텍스트 사이의 구조와 의미를 파악하는 것이 똑같이 핵심이 됩니다. 앞으로도 많이 읽고 쓰고 배우고 생각하면서 살고 싶습니다. 그리고 그걸 다른 사람과 나눌 수 있다면 더욱 행복할 것 같습니다. 저는 서투른 부분이 많고, 제가 모르고 있는 부족한 점도 아직 더 있는데요. 누구나 그렇듯이 더 나은 사람이 되기 위해 고민하면서 살고 있습니다. 그리고 그 과정에서 배우고 느끼는 점을 이곳에 기록하고 있습니다. | ||
--- | ||
|
||
안녕하세요 :) 김은빈입니다. | ||
import RecentPosts from '../../components/RecentPosts.astro'; | ||
|
||
누구나 그렇듯이 더 나은 사람이 되기 위해서 항상 고민하고 있습니다. <br/> | ||
그리고 그 과정에서 배우고 느끼는 점을 기록하고 있습니다. | ||
안녕하세요 :) 김은빈입니다. <br/> | ||
지금은 대덕SW마이스터고등학교 3학년으로 재학하면서 데브옵스를 공부하고 있는 학생입니다. | ||
|
||
|
||
글이나 코드를 읽고 짜는 걸 좋아합니다. <br/> | ||
목적성을 가지고 구조적인 텍스트를 작성한다는 점이 비슷한 것 같아요.<br/> | ||
|
||
글과 코드를 쓸 때는 무엇을 어떻게 표현할지 끊임없이 고민해야 하고, 완성도를 높이기 위해 많은 공부가 필요합니다. 글과 코드를 읽을 때에도 텍스트 사이의 구조와 의미를 파악하는 것이 똑같이 핵심이 됩니다. | ||
|
||
저에게는 그 과정이 너무 재밌는 것 같습니다. <br/> | ||
앞으로도 많이 읽고 쓰고 배우고 생각하면서 살고 싶습니다. <br/> | ||
그리고 그걸 다른 사람과 나눌 수 있다면 더욱 행복할 것 같습니다. | ||
|
||
저는 서투른 부분이 많고, 제가 모르고 있는 부족한 점도 아직 더 있는데요. <br/> | ||
누구나 그렇듯이 더 나은 사람이 되기 위해 열심히 고민하고 있습니다. <br/> | ||
그리고 그 과정에서 배우고 느끼는 점을 이곳에 기록하고 있습니다. | ||
|
||
들러주셔서 감사합니다. <br/> | ||
좋은 하루 보내세요 :) | ||
|
||
<div class="h-16"/> | ||
|
||
<RecentPosts/> |
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