Skip to content

Commit

Permalink
feat: nextjs 마이그레이션 마무리
Browse files Browse the repository at this point in the history
  • Loading branch information
SEOKKAMONI committed Dec 1, 2024
1 parent 7220a0d commit d414999
Show file tree
Hide file tree
Showing 24 changed files with 1,445 additions and 30 deletions.
1 change: 1 addition & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
images: {
remotePatterns: [
{
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
},
"dependencies": {
"clsx": "^2.1.1",
"gray-matter": "^4.0.3",
"marked": "^15.0.3",
"next": "14.2.18",
"overlay-kit": "^1.4.1",
"react": "^18",
Expand Down
87 changes: 87 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions posts/test.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: 테스트
date: 2024-12-01
thumbnail: "/images/test/thumbnail.png"
---

테스트
Binary file added public/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.
Binary file added src/app/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ import Providers from "./providers";

import "@/styles/globals.css";

export const metadata = {
title: "SEOKKAMONI.blog",
description: "blog.seokkamoni.me",
openGraph: {
title: "SEOKKAMONI.blog",
description: "blog.seokkamoni.me",
url: "https://blog.seokkamoni.me",
siteName: "SEOKKAMONI.blog",
},
metadataBase: new URL("https://blog.seokkamoni.me"),
};

const RootLayout = ({ children }: PropsWithChildren) => {
return (
<html lang="ko">
Expand Down
Binary file added src/app/opengraph-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions src/app/post/[title]/page.tsx
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;
2 changes: 1 addition & 1 deletion src/components/ContactOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cn } from "@/utils/twMerge";
import { cn } from "@/utils/cn";
import IconClose from "./icons/IconClose";

const SOCAILS = [
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { cn } from "@/utils/twMerge";
import { cn } from "@/utils/cn";
import { overlay } from "overlay-kit";
import { useEffect, useState } from "react";
import ContactOverlay from "./ContactOverlay";
Expand Down
6 changes: 2 additions & 4 deletions src/components/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import Link from "next/link";

const Logo = () => {
return (
<Link href="/">
<span className="cursor-pointer text-[18px] font-bold text-black">
SEOKKAMONI.blog
</span>
<Link href="/" className="cursor-pointer text-[18px] font-bold text-black">
SEOKKAMONI.blog
</Link>
);
};
Expand Down
20 changes: 20 additions & 0 deletions src/components/Markdown.tsx
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;
17 changes: 17 additions & 0 deletions src/components/Spacer.tsx
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;
Loading

0 comments on commit d414999

Please sign in to comment.