Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"clsx": "^2.1.1",
"lucide-react": "^0.544.0",
"next": "15.5.3",
"next-seo": "^6.8.0",
"react": "19.1.0",
"react-dom": "19.1.0",
"tailwind-merge": "^3.3.1",
Expand Down
19 changes: 19 additions & 0 deletions pnpm-lock.yaml

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

14 changes: 14 additions & 0 deletions src/app/lab/noindex/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Labs (Internal)",
robots: {
index: false,
follow: false,
googleBot: { index: false, follow: false, noimageindex: true, nosnippet: true },
},
};

export default function Page() {
return <main className="p-8">๋‚ด๋ถ€ ํ…Œ์ŠคํŠธ ํŽ˜์ด์ง€(๊ฒ€์ƒ‰ ์ œ์™ธ)</main>;
}
24 changes: 24 additions & 0 deletions src/app/lab/og-preview/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { withBase } from "@/seo/baseUrl"; // ์„ ํƒ: ์ ˆ๋Œ€ URL ์œ ํ‹ธ
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "PlanMate ํ”„๋กœ๋ชจ์…˜ Seed",
description: "๊ณต์œ  ์นด๋“œ(OG/Twitter) ํ…Œ์ŠคํŠธ์šฉ ํŽ˜์ด์ง€",
openGraph: {
title: "PlanMate ํ”„๋กœ๋ชจ์…˜ Seed",
description: "๊ณต์œ  ์นด๋“œ(OG/Twitter) ํ…Œ์ŠคํŠธ์šฉ ํŽ˜์ด์ง€",
images: [
{
url: withBase("/og/promo-seed.png"),
width: 1200,
height: 630,
alt: "PlanMate ํ”„๋กœ๋ชจ์…˜ Seed",
},
],
},
twitter: { card: "summary_large_image" },
};

export default function Page() {
return <main className="p-8">OG/Twitter ์นด๋“œ ํ…Œ์ŠคํŠธ ํŽ˜์ด์ง€</main>;
}
48 changes: 46 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,53 @@
// app/layout.tsx
import type { Metadata } from "next";
import "./globals.css";
import { Providers } from "./providers";

import {
DEFAULT_DESCRIPTION,
DEFAULT_TITLE,
LOCALE,
OG_DEFAULT_IMAGE,
SITE_NAME,
SITE_URL,
TITLE_TEMPLATE,
} from "@/seo/constants";

export const metadata: Metadata = {
title: "Custom Daily Planner",
description: "๋‚˜๋งŒ์˜ ๋งž์ถคํ˜• ํ”Œ๋ž˜๋„ˆ๋ฅผ ์†์‰ฝ๊ฒŒ ๋””์ž์ธํ•˜๊ณ  ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ์›น ์•ฑ",
// ์ ˆ๋Œ€ URL ๊ธฐ์ค€์  (canonical/OG ์ ˆ๋Œ€๊ฒฝ๋กœ ๋ณ€ํ™˜์— ์‚ฌ์šฉ)
metadataBase: new URL(SITE_URL),

// ์ „์—ญ ํƒ€์ดํ‹€ ๊ทœ์น™
title: {
default: DEFAULT_TITLE,
template: TITLE_TEMPLATE, // ์˜ˆ: "{ํŽ˜์ด์ง€์ œ๋ชฉ} | MyPlanMate"
},

// ์ „์—ญ ์„ค๋ช…
description: DEFAULT_DESCRIPTION,

// Open Graph ๊ธฐ๋ณธ๊ฐ’
openGraph: {
type: "website",
url: "/", // metadataBase ๊ธฐ์ค€์œผ๋กœ ์ ˆ๋Œ€ URL ์ฒ˜๋ฆฌ
siteName: SITE_NAME,
title: DEFAULT_TITLE,
description: DEFAULT_DESCRIPTION,
images: [
{
url: OG_DEFAULT_IMAGE, // "/og/og-default.png" โ†’ ์ ˆ๋Œ€ URL๋กœ ์ž๋™ ๋ณ€ํ™˜
width: 1200,
height: 630,
alt: `${SITE_NAME} ๋Œ€ํ‘œ ์ด๋ฏธ์ง€`,
},
],
locale: LOCALE, // "ko_KR"
},

// Twitter ์นด๋“œ ๊ธฐ๋ณธ๊ฐ’
twitter: {
card: "summary_large_image",
},
};

export default function RootLayout({ children }: { children: React.ReactNode }) {
Expand All @@ -25,6 +68,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
</ThemeProvider>
</AuthProvider>
*/}

<Providers>{children}</Providers>
</body>
</html>
Expand Down
10 changes: 10 additions & 0 deletions src/seo/baseUrl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const getBaseUrl = () => {
const fromEnv = process.env.NEXT_PUBLIC_SITE_URL?.replace(/\/$/, "");
return fromEnv ?? "http://localhost:3000";
};

export const withBase = (path = "/") => {
const base = getBaseUrl();
if (!path.startsWith("/")) return path; // ์ด๋ฏธ ์ ˆ๋Œ€ ์ฃผ์†Œ๋ฉด ๊ทธ๋Œ€๋กœ
return `${base}${path}`;
};
12 changes: 12 additions & 0 deletions src/seo/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const SITE_NAME = "MyPlanMate";

export const SITE_URL =
process.env.NEXT_PUBLIC_SITE_URL?.replace(/\/$/, "") ?? "http://localhost:3000";

export const DEFAULT_TITLE = `${SITE_NAME} - ๋‚˜๋งŒ์˜ ๋งž์ถคํ˜• ํ”Œ๋ž˜๋„ˆ`;
export const TITLE_TEMPLATE = `%s | ${SITE_NAME}`;
export const DEFAULT_DESCRIPTION =
"์ผ๊ฐ„ยท์ฃผ๊ฐ„ยท์›”๊ฐ„ยทํˆฌ๋‘ยท์Šต๊ด€ยท๋ฉ”๋ชจ๋ฅผ ์ž์œ ๋กญ๊ฒŒ ์กฐํ•ฉํ•˜๋Š” ์ปค์Šคํ…€ ํ”Œ๋ž˜๋„ˆ";

export const OG_DEFAULT_IMAGE = "/og/og-default.png"; // metadataBase๋กœ ์ ˆ๋Œ€๊ฒฝ๋กœ ํ•ด์„
export const LOCALE = "ko_KR";