From 294aac6cde9ba2556389b2b7df2887470cdb274a Mon Sep 17 00:00:00 2001 From: Lee-Seungje Date: Tue, 4 Jun 2024 19:37:04 +0900 Subject: [PATCH 1/6] Update inquiry --- src/app/inquiry/page.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/inquiry/page.tsx b/src/app/inquiry/page.tsx index 4781ace..0fd756a 100644 --- a/src/app/inquiry/page.tsx +++ b/src/app/inquiry/page.tsx @@ -1,7 +1,13 @@ -import { cookies } from "next/headers"; - import { InquiryPage } from "@/pageContainer"; + +import { cookies } from "next/headers"; import { redirect } from "next/navigation"; +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "문의 | Bitguoel", + description: "빛고을배드민턴클럽의 문의하기 페이지입니다.", +}; export default async function Inquiry() { const isMailed = cookies().get("isMailed")?.value; From 10a50c271169c6689e9b686915a5be95f122d364 Mon Sep 17 00:00:00 2001 From: Lee-Seungje Date: Tue, 4 Jun 2024 19:37:31 +0900 Subject: [PATCH 2/6] Update introduce --- src/app/introduce/page.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/introduce/page.tsx b/src/app/introduce/page.tsx index be047d6..6b47e62 100644 --- a/src/app/introduce/page.tsx +++ b/src/app/introduce/page.tsx @@ -1,5 +1,12 @@ import { IntroducePage } from "@/pageContainer"; +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "소개 | Bitguoel", + description: "빛고을배드민턴클럽의 소개 페이지입니다.", +}; + export default async function Introduce() { return ; } From e3f47548dbd2f6c538a8361fbc634f1139ac5dcd Mon Sep 17 00:00:00 2001 From: Lee-Seungje Date: Tue, 4 Jun 2024 19:38:56 +0900 Subject: [PATCH 3/6] Update gallery --- src/app/gallery/page.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/gallery/page.tsx b/src/app/gallery/page.tsx index c9bab6d..cb969a1 100644 --- a/src/app/gallery/page.tsx +++ b/src/app/gallery/page.tsx @@ -1,5 +1,12 @@ import { NotionPage } from "@/pageContainer"; +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "갤러리 | Bitguoel", + description: "빛고을배드민턴클럽의 행사갤러리 페이지입니다.", +}; + export default function Gallery() { return ; } From b51ef486140c072963b7fca4c9ea065826a3b449 Mon Sep 17 00:00:00 2001 From: Lee-Seungje Date: Wed, 5 Jun 2024 10:58:22 +0900 Subject: [PATCH 4/6] Add generateMetadata --- src/app/gallery/[id]/page.tsx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/app/gallery/[id]/page.tsx b/src/app/gallery/[id]/page.tsx index 9dd2896..d8979ba 100644 --- a/src/app/gallery/[id]/page.tsx +++ b/src/app/gallery/[id]/page.tsx @@ -4,7 +4,7 @@ import { NotionDetailPage } from "@/pageContainer"; import { notion } from "@/lib"; import { gallery } from "@/constant"; -import { redirect } from "next/navigation"; +import { redirect, notFound } from "next/navigation"; import type { Metadata } from "next"; export const metadata: Metadata = { @@ -20,6 +20,26 @@ interface Params { }; } +export const generateMetadata = async ({ + params, +}: Params): Promise => { + try { + const { title, description } = gallery[parseInt(params.id)]; + + return { + title: { absolute: title }, + description: description.slice(120), + openGraph: { + title: title, + description: description.slice(120), + url: `https://www.frorong.shop/gallery/${params.id}`, + }, + }; + } catch (e) { + return notFound(); + } +}; + export default async function Gallery({ params: { id } }: Params) { const currentGallery = gallery[parseInt(id)]; From 4d7faece00df93cbb389614d71f216993ca6d135 Mon Sep 17 00:00:00 2001 From: Lee-Seungje Date: Wed, 5 Jun 2024 10:59:29 +0900 Subject: [PATCH 5/6] Add generateMetadata --- src/app/gallery/[id]/page.tsx | 5 ----- src/app/notice/[id]/page.tsx | 27 +++++++++++++++++++++------ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/app/gallery/[id]/page.tsx b/src/app/gallery/[id]/page.tsx index d8979ba..f3be112 100644 --- a/src/app/gallery/[id]/page.tsx +++ b/src/app/gallery/[id]/page.tsx @@ -7,11 +7,6 @@ import { gallery } from "@/constant"; import { redirect, notFound } from "next/navigation"; import type { Metadata } from "next"; -export const metadata: Metadata = { - title: "빛고을배드민턴클럽 홈패이지", - description: "빛고을배드민턴클럽의 홈패이지입니다.", -}; - const GALLERY_LIST_PAGE = "/gallery" as const; interface Params { diff --git a/src/app/notice/[id]/page.tsx b/src/app/notice/[id]/page.tsx index e227a63..a79a6ff 100644 --- a/src/app/notice/[id]/page.tsx +++ b/src/app/notice/[id]/page.tsx @@ -4,14 +4,9 @@ import { NotionDetailPage } from "@/pageContainer"; import { notion } from "@/lib"; import { notice } from "@/constant"; -import { redirect } from "next/navigation"; +import { redirect, notFound } from "next/navigation"; import type { Metadata } from "next"; -export const metadata: Metadata = { - title: "빛고을배드민턴클럽 홈패이지", - description: "빛고을배드민턴클럽의 홈패이지입니다.", -}; - const NOTICE_LIST_PATH = "/notice" as const; interface Params { @@ -20,6 +15,26 @@ interface Params { }; } +export const generateMetadata = async ({ + params, +}: Params): Promise => { + try { + const { title, description } = notice[parseInt(params.id)]; + + return { + title: { absolute: title }, + description: description.slice(120), + openGraph: { + title: title, + description: description.slice(120), + url: `https://www.frorong.shop/gallery/${params.id}`, + }, + }; + } catch (e) { + return notFound(); + } +}; + export default async function Notice({ params: { id } }: Params) { const currentNotice = notice[parseInt(id)]; From 58e1cc6f2aaecb4c7f11b386a8af5638ec9b14e2 Mon Sep 17 00:00:00 2001 From: Lee-Seungje Date: Wed, 5 Jun 2024 10:59:52 +0900 Subject: [PATCH 6/6] Update notice --- src/app/notice/page.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/notice/page.tsx b/src/app/notice/page.tsx index 79288a0..2a291b0 100644 --- a/src/app/notice/page.tsx +++ b/src/app/notice/page.tsx @@ -1,5 +1,12 @@ import { NotionPage } from "@/pageContainer"; +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "공지 | Bitguoel", + description: "빛고을배드민턴클럽의 공지 페이지입니다.", +}; + export default function Notice() { return ; }