-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
7220a0d
commit d414999
Showing
24 changed files
with
1,445 additions
and
30 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,7 @@ | ||
--- | ||
title: 테스트 | ||
date: 2024-12-01 | ||
thumbnail: "/images/test/thumbnail.png" | ||
--- | ||
|
||
테스트 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,29 @@ | ||
import { getPosts } from "@/utils/getPosts"; | ||
import PostView from "@/views/PostView"; | ||
import type { Metadata } from "next"; | ||
|
||
export type PostPageParams = { title: string }; | ||
|
||
interface PostPageProps { | ||
params: PostPageParams; | ||
} | ||
|
||
export const generateMetadata = ({ params }: PostPageProps): Metadata => { | ||
const posts = getPosts(); | ||
const post = posts.find(async (post) => post.title === params.title); | ||
const ogImage = post?.thumbnail || "/opengraph-image.png"; | ||
|
||
return { | ||
title: post?.title, | ||
openGraph: { | ||
publishedTime: post?.date, | ||
images: [ogImage], | ||
}, | ||
}; | ||
}; | ||
|
||
const PostPage = async ({ params }: PostPageProps) => ( | ||
<PostView params={params} /> | ||
); | ||
|
||
export default PostPage; |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { marked } from "marked"; | ||
|
||
import "@/styles/markdown.css"; | ||
|
||
interface MarkdownProps { | ||
html: string; | ||
} | ||
|
||
const Markdown = ({ html }: MarkdownProps) => { | ||
const __html = marked(html, { async: false }); | ||
|
||
return ( | ||
<div | ||
className="markdown-body w-full h-full" | ||
dangerouslySetInnerHTML={{ __html }} | ||
/> | ||
); | ||
}; | ||
|
||
export default Markdown; |
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 SpacerProps { | ||
height?: string | number; | ||
width?: string | number; | ||
} | ||
|
||
const Spacer = ({ height, width }: SpacerProps) => { | ||
return ( | ||
<div | ||
style={{ | ||
width: typeof width === "number" ? `${width}px` : width, | ||
height: typeof height === "number" ? `${height}px` : height, | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export default Spacer; |
Oops, something went wrong.