From 4a897285f3ffc8c3cd36122f4b3487bf890279d4 Mon Sep 17 00:00:00 2001 From: chaeney Date: Thu, 17 Oct 2024 13:33:43 +0900 Subject: [PATCH 1/8] =?UTF-8?q?[KAN-135]=20setting:=20=EB=AA=A8=EB=93=A0?= =?UTF-8?q?=20=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=20Metadata=20title=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(auth)/signin/page.tsx | 2 +- src/app/(auth)/signup/page.tsx | 2 +- src/app/(main)/gatherings/page.tsx | 6 ++++++ src/app/(main)/mypage/created/page.tsx | 10 ++++++++-- src/app/(main)/mypage/page.tsx | 2 +- src/app/(main)/mypage/review/writable/page.tsx | 6 ++++++ src/app/(main)/mypage/review/written/page.tsx | 6 ++++++ src/app/(main)/reviews/page.tsx | 6 ++++++ src/app/(main)/saved/page.tsx | 7 ++++++- src/app/layout.tsx | 7 +++++-- 10 files changed, 46 insertions(+), 8 deletions(-) diff --git a/src/app/(auth)/signin/page.tsx b/src/app/(auth)/signin/page.tsx index ed0244d0..cadc0055 100644 --- a/src/app/(auth)/signin/page.tsx +++ b/src/app/(auth)/signin/page.tsx @@ -2,7 +2,7 @@ import SignInForm from '@/app/(auth)/signin/_component/SignInForm'; import { Metadata } from 'next'; export const metadata: Metadata = { - title: '로그인 | Soothe With Me', + title: '로그인', description: 'Soothe With Me 로그인 페이지입니다.', }; diff --git a/src/app/(auth)/signup/page.tsx b/src/app/(auth)/signup/page.tsx index 18217b60..51c4eb91 100644 --- a/src/app/(auth)/signup/page.tsx +++ b/src/app/(auth)/signup/page.tsx @@ -2,7 +2,7 @@ import SignUpForm from '@/app/(auth)/signup/_component/SignUpForm'; import { Metadata } from 'next'; export const metadata: Metadata = { - title: '회원가입 | Soothe With Me', + title: '회원가입', description: 'Soothe With Me 회원가입 페이지입니다.', }; diff --git a/src/app/(main)/gatherings/page.tsx b/src/app/(main)/gatherings/page.tsx index fff4018a..ecd95df7 100644 --- a/src/app/(main)/gatherings/page.tsx +++ b/src/app/(main)/gatherings/page.tsx @@ -1,8 +1,14 @@ +import { Metadata } from 'next'; import Header from './_component/Header'; import ClientSideGatherings from './_component/ClientSideGatherings'; import getGatherings from '@/app/api/actions/gatherings/getGatherings'; import { getUserData } from '@/app/api/actions/mypage/getUserData'; +export const metadata: Metadata = { + title: '모임 찾기', + description: 'Soothe With Me 모임 찾기 페이지입니다.', +}; + const GatheringsPage = async () => { const gatherings = await getGatherings({ type: 'DALLAEMFIT', diff --git a/src/app/(main)/mypage/created/page.tsx b/src/app/(main)/mypage/created/page.tsx index 783c185f..6d26225b 100644 --- a/src/app/(main)/mypage/created/page.tsx +++ b/src/app/(main)/mypage/created/page.tsx @@ -1,9 +1,15 @@ -import { getUserData } from '@/app/api/actions/mypage/getUserData'; +import { Metadata } from 'next'; +import { redirect } from 'next/navigation'; import ClientSideGatherings from './_component/ClientSideGatherings'; +import { getUserData } from '@/app/api/actions/mypage/getUserData'; import getGatherings from '@/app/api/actions/gatherings/getGatherings'; -import { redirect } from 'next/navigation'; import { SORT_OPTIONS_MAP } from '@/constants/common'; +export const metadata: Metadata = { + title: '내가 만든 모임', + description: 'Soothe With Me 내가 만든 모임 페이지입니다.', +}; + const CreatedPage = async () => { const userData = await getUserData(); diff --git a/src/app/(main)/mypage/page.tsx b/src/app/(main)/mypage/page.tsx index 80af5d6d..785c0fad 100644 --- a/src/app/(main)/mypage/page.tsx +++ b/src/app/(main)/mypage/page.tsx @@ -4,7 +4,7 @@ import getMyGatherings from '@/app/api/actions/gatherings/getMyGatherings'; import { getUserData } from '@/app/api/actions/mypage/getUserData'; export const metadata: Metadata = { - title: '나의 모임 | Soothe With Me', + title: '나의 모임', description: 'Soothe With Me 나의 모임 페이지입니다.', }; diff --git a/src/app/(main)/mypage/review/writable/page.tsx b/src/app/(main)/mypage/review/writable/page.tsx index cbf65f2c..6e085a0d 100644 --- a/src/app/(main)/mypage/review/writable/page.tsx +++ b/src/app/(main)/mypage/review/writable/page.tsx @@ -1,5 +1,6 @@ 'use client'; +import { Metadata } from 'next'; import getJoinedGatherings from '@/app/api/actions/gatherings/getJoinedGathering'; import Card from '@/app/components/Card/Card'; import ReviewModal from '@/app/components/Modal/ReviewModal'; @@ -13,6 +14,11 @@ import useScrollGradientEffect from '@/hooks/useScrollGradientEffect'; import GradientOverlay from '@/app/components/GradientOverlay/GradientOverlay'; import MotionWrapper from '@/app/components/MotionWrapper/MotionWrapper'; +export const metadata: Metadata = { + title: '나의 리뷰', + description: 'Soothe With Me 나의 리뷰 페이지입니다.', +}; + const WritableReviewsPage = () => { const [isModalOpen, setIsModalOpen] = useState(false); const [cardId, setCardId] = useState(0); diff --git a/src/app/(main)/mypage/review/written/page.tsx b/src/app/(main)/mypage/review/written/page.tsx index dcb7f273..0d6d3933 100644 --- a/src/app/(main)/mypage/review/written/page.tsx +++ b/src/app/(main)/mypage/review/written/page.tsx @@ -1,3 +1,4 @@ +import { Metadata } from 'next'; import { getUserData } from '@/app/api/actions/mypage/getUserData'; import getReviewList from '@/app/api/actions/reviews/getReviewList'; import { redirect } from 'next/navigation'; @@ -5,6 +6,11 @@ import EmptyReviewPage from '../../_component/EmptyReviewPage'; import ReviewFilterTab from '../../_component/ReviewFilterTab'; import ReviewsList from './_component/ReviewsList'; +export const metadata: Metadata = { + title: '나의 리뷰', + description: 'Soothe With Me 나의 리뷰 페이지입니다.', +}; + const WrittenReviewsPage = async () => { const user = await getUserData(); diff --git a/src/app/(main)/reviews/page.tsx b/src/app/(main)/reviews/page.tsx index 77b0efaa..a4237cb6 100644 --- a/src/app/(main)/reviews/page.tsx +++ b/src/app/(main)/reviews/page.tsx @@ -1,8 +1,14 @@ +import { Metadata } from 'next'; import Header from './_components/Hearder'; import ClientSideReviews from './_components/ClientSideReviews'; import getReviewList from '@/app/api/actions/reviews/getReviewList'; import getReviewScore from '@/app/api/actions/reviews/getReviewScore'; +export const metadata: Metadata = { + title: '모든 리뷰', + description: 'Soothe With Me 모든 리뷰 페이지입니다.', +}; + const ReviewsPage = async () => { const reviewList = await getReviewList({ type: 'DALLAEMFIT' }); const reviewScore = await getReviewScore({ type: 'DALLAEMFIT' }); diff --git a/src/app/(main)/saved/page.tsx b/src/app/(main)/saved/page.tsx index b7700b5e..fe2336de 100644 --- a/src/app/(main)/saved/page.tsx +++ b/src/app/(main)/saved/page.tsx @@ -1,15 +1,20 @@ 'use client'; +import { Metadata } from 'next'; import Tabs from '@/app/components/Tabs/Tabs'; import Chips from '@/app/components/Chips/Chips'; import Filters from '@/app/components/Filters/Filters'; +import MotionWrapper from '@/app/components/MotionWrapper/MotionWrapper'; import Header from './_component/Header'; import SavedList from './_component/SavedList'; import useSavedGatherings from '@/hooks/useSavedGatherings'; import { useSavedGatheringList } from '@/context/SavedGatheringContext'; import { SORT_OPTIONS } from '@/constants/common'; -import MotionWrapper from '@/app/components/MotionWrapper/MotionWrapper'; +export const metadata: Metadata = { + title: '찜한 모임', + description: 'Soothe With Me 찜한 모임 페이지입니다.', +}; const SavedPage = () => { const { savedGatherings } = useSavedGatheringList(); diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 92b3d050..a2dffc83 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -12,9 +12,12 @@ import { Toaster } from 'react-hot-toast'; import { getCookie } from './api/actions/cookie/cookie'; export const metadata: Metadata = { - title: 'Soothe With Me', + title: { + template: '%s | Soothe With Me', + default: 'Soothe With Me', + }, description: - '유저가 바쁜 일상 속 휴식을 위한 다양한 모임을 탐색하고 참여하며, 직접 모임을 개설하고 리뷰를 생성할 수 있는 서비스입니다.', + '바쁜 일상 속 휴식을 위한 다양한 모임을 탐색하고 참여하며, 직접 모임을 개설하고 리뷰를 생성할 수 있는 서비스', icons: { icon: '/icons/bye.svg', }, From 30c022c64d662eda83674bd6971a11619e1fe998 Mon Sep 17 00:00:00 2001 From: chaeney Date: Thu, 17 Oct 2024 16:13:33 +0900 Subject: [PATCH 2/8] =?UTF-8?q?[KAN-135]=20setting:=20=EB=AA=A8=EB=93=A0?= =?UTF-8?q?=20=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=20Metadata=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(auth)/signin/page.tsx | 6 +- src/app/(auth)/signup/page.tsx | 6 +- src/app/(main)/gatherings/[id]/page.tsx | 11 ++ src/app/(main)/gatherings/page.tsx | 6 +- src/app/(main)/mypage/created/page.tsx | 9 +- src/app/(main)/mypage/page.tsx | 6 +- .../(main)/mypage/review/writable/page.tsx | 9 +- src/app/(main)/mypage/review/written/page.tsx | 9 +- src/app/(main)/reviews/page.tsx | 6 +- src/app/(main)/saved/page.tsx | 6 +- src/app/layout.tsx | 14 +-- src/utils/makeMetadata.ts | 118 ++++++++++++++++++ 12 files changed, 159 insertions(+), 47 deletions(-) create mode 100644 src/utils/makeMetadata.ts diff --git a/src/app/(auth)/signin/page.tsx b/src/app/(auth)/signin/page.tsx index cadc0055..591cd41e 100644 --- a/src/app/(auth)/signin/page.tsx +++ b/src/app/(auth)/signin/page.tsx @@ -1,10 +1,8 @@ import SignInForm from '@/app/(auth)/signin/_component/SignInForm'; import { Metadata } from 'next'; +import { pageMetadata } from '@/utils/makeMetadata'; -export const metadata: Metadata = { - title: '로그인', - description: 'Soothe With Me 로그인 페이지입니다.', -}; +export const metadata: Metadata = pageMetadata('로그인', '/signin'); const SignIn = () => { return ; diff --git a/src/app/(auth)/signup/page.tsx b/src/app/(auth)/signup/page.tsx index 51c4eb91..2331249c 100644 --- a/src/app/(auth)/signup/page.tsx +++ b/src/app/(auth)/signup/page.tsx @@ -1,10 +1,8 @@ import SignUpForm from '@/app/(auth)/signup/_component/SignUpForm'; import { Metadata } from 'next'; +import { pageMetadata } from '@/utils/makeMetadata'; -export const metadata: Metadata = { - title: '회원가입', - description: 'Soothe With Me 회원가입 페이지입니다.', -}; +export const metadata: Metadata = pageMetadata('회원가입', '/signup'); const SignUp = () => { return ; diff --git a/src/app/(main)/gatherings/[id]/page.tsx b/src/app/(main)/gatherings/[id]/page.tsx index 5390ad55..df811af8 100644 --- a/src/app/(main)/gatherings/[id]/page.tsx +++ b/src/app/(main)/gatherings/[id]/page.tsx @@ -9,6 +9,17 @@ import getGatheringParticipants from '@/app/api/actions/gatherings/getGatheringP import getGatheringInfo from '@/app/api/actions/gatherings/getGatheringInfo'; import { getUserData } from '@/app/api/actions/mypage/getUserData'; import { UserData } from '@/types/client.type'; +import { gatheringMetadata } from '@/utils/makeMetadata'; + +export const generateMetadata = async ({ + params, +}: { + params: { + id: number; + }; +}) => { + return await gatheringMetadata(params.id); +}; const GatheringsDetailPage = async ({ params, diff --git a/src/app/(main)/gatherings/page.tsx b/src/app/(main)/gatherings/page.tsx index ecd95df7..33f3ffd6 100644 --- a/src/app/(main)/gatherings/page.tsx +++ b/src/app/(main)/gatherings/page.tsx @@ -3,11 +3,9 @@ import Header from './_component/Header'; import ClientSideGatherings from './_component/ClientSideGatherings'; import getGatherings from '@/app/api/actions/gatherings/getGatherings'; import { getUserData } from '@/app/api/actions/mypage/getUserData'; +import { pageMetadata } from '@/utils/makeMetadata'; -export const metadata: Metadata = { - title: '모임 찾기', - description: 'Soothe With Me 모임 찾기 페이지입니다.', -}; +export const metadata: Metadata = pageMetadata('모임찾기', '/gatherings'); const GatheringsPage = async () => { const gatherings = await getGatherings({ diff --git a/src/app/(main)/mypage/created/page.tsx b/src/app/(main)/mypage/created/page.tsx index 6d26225b..e91cf744 100644 --- a/src/app/(main)/mypage/created/page.tsx +++ b/src/app/(main)/mypage/created/page.tsx @@ -4,11 +4,12 @@ import ClientSideGatherings from './_component/ClientSideGatherings'; import { getUserData } from '@/app/api/actions/mypage/getUserData'; import getGatherings from '@/app/api/actions/gatherings/getGatherings'; import { SORT_OPTIONS_MAP } from '@/constants/common'; +import { pageMetadata } from '@/utils/makeMetadata'; -export const metadata: Metadata = { - title: '내가 만든 모임', - description: 'Soothe With Me 내가 만든 모임 페이지입니다.', -}; +export const metadata: Metadata = pageMetadata( + '내가 만든 모임', + '/mypage/created', +); const CreatedPage = async () => { const userData = await getUserData(); diff --git a/src/app/(main)/mypage/page.tsx b/src/app/(main)/mypage/page.tsx index 785c0fad..a236e34b 100644 --- a/src/app/(main)/mypage/page.tsx +++ b/src/app/(main)/mypage/page.tsx @@ -2,11 +2,9 @@ import { Metadata } from 'next'; import MyGatheringList from './_component/MyGatheringList'; import getMyGatherings from '@/app/api/actions/gatherings/getMyGatherings'; import { getUserData } from '@/app/api/actions/mypage/getUserData'; +import { pageMetadata } from '@/utils/makeMetadata'; -export const metadata: Metadata = { - title: '나의 모임', - description: 'Soothe With Me 나의 모임 페이지입니다.', -}; +export const metadata: Metadata = pageMetadata('나의 모임', '/mypage'); const Mygatherings = async () => { const myGatherings = await getMyGatherings(); diff --git a/src/app/(main)/mypage/review/writable/page.tsx b/src/app/(main)/mypage/review/writable/page.tsx index 6e085a0d..ed537397 100644 --- a/src/app/(main)/mypage/review/writable/page.tsx +++ b/src/app/(main)/mypage/review/writable/page.tsx @@ -13,11 +13,12 @@ import { queries } from '@/queries'; import useScrollGradientEffect from '@/hooks/useScrollGradientEffect'; import GradientOverlay from '@/app/components/GradientOverlay/GradientOverlay'; import MotionWrapper from '@/app/components/MotionWrapper/MotionWrapper'; +import { pageMetadata } from '@/utils/makeMetadata'; -export const metadata: Metadata = { - title: '나의 리뷰', - description: 'Soothe With Me 나의 리뷰 페이지입니다.', -}; +export const metadata: Metadata = pageMetadata( + '나의 리뷰', + '/mypage/review/writable', +); const WritableReviewsPage = () => { const [isModalOpen, setIsModalOpen] = useState(false); diff --git a/src/app/(main)/mypage/review/written/page.tsx b/src/app/(main)/mypage/review/written/page.tsx index 0d6d3933..f9932af4 100644 --- a/src/app/(main)/mypage/review/written/page.tsx +++ b/src/app/(main)/mypage/review/written/page.tsx @@ -5,11 +5,12 @@ import { redirect } from 'next/navigation'; import EmptyReviewPage from '../../_component/EmptyReviewPage'; import ReviewFilterTab from '../../_component/ReviewFilterTab'; import ReviewsList from './_component/ReviewsList'; +import { pageMetadata } from '@/utils/makeMetadata'; -export const metadata: Metadata = { - title: '나의 리뷰', - description: 'Soothe With Me 나의 리뷰 페이지입니다.', -}; +export const metadata: Metadata = pageMetadata( + '나의 리뷰', + '/mypage/review/written', +); const WrittenReviewsPage = async () => { const user = await getUserData(); diff --git a/src/app/(main)/reviews/page.tsx b/src/app/(main)/reviews/page.tsx index a4237cb6..166d1397 100644 --- a/src/app/(main)/reviews/page.tsx +++ b/src/app/(main)/reviews/page.tsx @@ -3,11 +3,9 @@ import Header from './_components/Hearder'; import ClientSideReviews from './_components/ClientSideReviews'; import getReviewList from '@/app/api/actions/reviews/getReviewList'; import getReviewScore from '@/app/api/actions/reviews/getReviewScore'; +import { pageMetadata } from '@/utils/makeMetadata'; -export const metadata: Metadata = { - title: '모든 리뷰', - description: 'Soothe With Me 모든 리뷰 페이지입니다.', -}; +export const metadata: Metadata = pageMetadata('모든 리뷰', '/reviews'); const ReviewsPage = async () => { const reviewList = await getReviewList({ type: 'DALLAEMFIT' }); diff --git a/src/app/(main)/saved/page.tsx b/src/app/(main)/saved/page.tsx index fe2336de..5641802e 100644 --- a/src/app/(main)/saved/page.tsx +++ b/src/app/(main)/saved/page.tsx @@ -10,11 +10,9 @@ import SavedList from './_component/SavedList'; import useSavedGatherings from '@/hooks/useSavedGatherings'; import { useSavedGatheringList } from '@/context/SavedGatheringContext'; import { SORT_OPTIONS } from '@/constants/common'; +import { pageMetadata } from '@/utils/makeMetadata'; -export const metadata: Metadata = { - title: '찜한 모임', - description: 'Soothe With Me 찜한 모임 페이지입니다.', -}; +export const metadata: Metadata = pageMetadata('찜한 모임', '/saved'); const SavedPage = () => { const { savedGatherings } = useSavedGatheringList(); diff --git a/src/app/layout.tsx b/src/app/layout.tsx index a2dffc83..7bcd1fdf 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -11,17 +11,9 @@ import { toastOptions } from '@/constants/toast.config'; import { Toaster } from 'react-hot-toast'; import { getCookie } from './api/actions/cookie/cookie'; -export const metadata: Metadata = { - title: { - template: '%s | Soothe With Me', - default: 'Soothe With Me', - }, - description: - '바쁜 일상 속 휴식을 위한 다양한 모임을 탐색하고 참여하며, 직접 모임을 개설하고 리뷰를 생성할 수 있는 서비스', - icons: { - icon: '/icons/bye.svg', - }, -}; +import { rootMetadata } from '@/utils/makeMetadata'; + +export const metadata: Metadata = rootMetadata; export default async function RootLayout({ children, diff --git a/src/utils/makeMetadata.ts b/src/utils/makeMetadata.ts new file mode 100644 index 00000000..22d155b2 --- /dev/null +++ b/src/utils/makeMetadata.ts @@ -0,0 +1,118 @@ +const BASE_URL = `${process.env.NEXT_PUBLIC_BASE_URL}`; + +export const rootMetadata = { + metadataBase: new URL(BASE_URL), + title: { + template: '%s | Soothe With Me', + default: 'Soothe With Me', + }, + description: + '바쁜 일상 속 휴식을 위한 다양한 모임을 탐색하고 참여하며, 직접 모임을 개설하고 리뷰를 생성할 수 있는 서비스입니다.', + icons: { + icon: '/icons/bye.svg', + }, + keywords: + '같이달램, Soothe with me, 달램핏, 워케이션, 마인드풀니스, 오피스스트레칭, 모임, 휴식, 소통, 힐링, 취미, 취향, 소모임', + robots: { + index: true, + follow: true, + }, + openGraph: { + title: { + template: '%s | Soothe With Me', + default: 'Soothe With Me', + }, + description: + '다양한 휴식 모임을 탐색하고 참여하며 직접 개설할 수 있는 서비스.', + url: BASE_URL, + siteName: 'Soothe With Me', + type: 'website', + locale: 'ko_KR', + images: [ + { + url: '/images/login-img.svg', + width: 800, + height: 600, + alt: 'Soothe With Me', + }, + ], + }, + twitter: { + title: { + template: '%s | Soothe With Me', + default: 'Soothe With Me', + }, + description: + '바쁜 일상 속 휴식을 위한 다양한 모임을 제공하는 Soothe With Me 서비스.', + images: [ + { + url: '/images/login-img.svg', + width: 800, + height: 600, + alt: 'Soothe With Me', + }, + ], + }, + alternates: { + canonical: `${process.env.NEXT_PUBLIC_BASE_URL}/gatherings`, + }, +}; + +import getGatheringInfo from '@/app/api/actions/gatherings/getGatheringInfo'; +import { GatheringInfoType } from '@/types/data.type'; + +export const pageMetadata = (page: string, path: string) => { + return { + title: page, + description: `Soothe With Me ${page} 페이지입니다.`, + openGraph: { + title: page, + description: `Soothe With Me | ${page} .`, + url: `${BASE_URL}${path}`, + }, + twitter: { + title: page, + description: `Soothe With Me | ${page} .`, + url: `${BASE_URL}${path}`, + }, + }; +}; + +export const gatheringMetadata = async (id: number) => { + const gatheringInfo: GatheringInfoType = await getGatheringInfo(id); + + const name = gatheringInfo.name || ''; + const type = gatheringInfo.type; + const img = gatheringInfo.image; + + return { + title: name, + description: `${type} : ${name}`, + openGraph: { + title: name, + description: `${type} : ${name}`, + url: `${BASE_URL}/gatherings/${id}`, + images: [ + { + url: img || '/images/login-img.svg', + width: 800, + height: 600, + alt: `${name} 모임 이미지`, + }, + ], + }, + twitter: { + title: name, + description: `${type} : ${name}`, + url: `${BASE_URL}/gatherings/${id}`, + images: [ + { + url: img || '/images/login-img.svg', + width: 800, + height: 600, + alt: `${name} 모임 이미지`, + }, + ], + }, + }; +}; From 7a66910000c82fa0664f4a7364f8b4503227da60 Mon Sep 17 00:00:00 2001 From: chaeney Date: Thu, 17 Oct 2024 16:16:37 +0900 Subject: [PATCH 3/8] =?UTF-8?q?[KAN-135]=20setting:=20=EB=A9=94=ED=83=80?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/makeMetadata.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/makeMetadata.ts b/src/utils/makeMetadata.ts index 22d155b2..f6fd356e 100644 --- a/src/utils/makeMetadata.ts +++ b/src/utils/makeMetadata.ts @@ -56,6 +56,9 @@ export const rootMetadata = { alternates: { canonical: `${process.env.NEXT_PUBLIC_BASE_URL}/gatherings`, }, + other: { + 'google-site-verification': '3TzGNrqEDpp12jYWOwKcH92cFxvYmfrz-0lspdNdTwo', + }, }; import getGatheringInfo from '@/app/api/actions/gatherings/getGatheringInfo'; From 5a912844cc00c1f484efb878930c4a1e732205f0 Mon Sep 17 00:00:00 2001 From: chaeney Date: Thu, 17 Oct 2024 16:22:14 +0900 Subject: [PATCH 4/8] =?UTF-8?q?[KAN-135]=20setting:=20sitemap,=20robots=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 1 + src/app/robots.txt | 5 ++++ src/app/sitemap.ts | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 src/app/robots.txt create mode 100644 src/app/sitemap.ts diff --git a/.env b/.env index 21eb61f0..b7b51cb6 100644 --- a/.env +++ b/.env @@ -1 +1,2 @@ NEXT_PUBLIC_API_BASE_URL=https://fe-adv-project-together-dallaem.vercel.app/3-4 +NEXT_PUBLIC_BASE_URL=https://soothe-with-me.vercel.app diff --git a/src/app/robots.txt b/src/app/robots.txt new file mode 100644 index 00000000..52e9c78c --- /dev/null +++ b/src/app/robots.txt @@ -0,0 +1,5 @@ +User-agent: * +Disallow: /mypage/ +Allow: / + +Sitemap: https://soothe-with-me.vercel.app/sitemap \ No newline at end of file diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts new file mode 100644 index 00000000..9e087cec --- /dev/null +++ b/src/app/sitemap.ts @@ -0,0 +1,68 @@ +import { MetadataRoute } from 'next'; + +const BASE_URL = `${process.env.NEXT_PUBLIC_BASE_URL}`; + +export default function sitemap(): MetadataRoute.Sitemap { + return [ + { + url: BASE_URL, + lastModified: new Date(), + changeFrequency: 'yearly', + priority: 0.5, + }, + { + url: `${BASE_URL}/gatherings`, + lastModified: new Date(), + changeFrequency: 'daily', + priority: 1, + }, + { + url: `${BASE_URL}/saved`, + lastModified: new Date(), + changeFrequency: 'daily', + priority: 0.8, + }, + { + url: `${BASE_URL}/reviews`, + lastModified: new Date(), + changeFrequency: 'daily', + priority: 0.8, + }, + { + url: `${BASE_URL}/signup`, + lastModified: new Date(), + changeFrequency: 'yearly', + priority: 0.5, + }, + { + url: `${BASE_URL}/signin`, + lastModified: new Date(), + changeFrequency: 'yearly', + priority: 0.5, + }, + { + url: `${BASE_URL}/mypage`, + lastModified: new Date(), + changeFrequency: 'daily', + priority: 0.7, + }, + { + url: `${BASE_URL}/mypage/review/writable`, + lastModified: new Date(), + changeFrequency: 'daily', + priority: 0.7, + }, + { + url: `${BASE_URL}/mypage/review/written`, + lastModified: new Date(), + changeFrequency: 'daily', + priority: 0.7, + }, + { + url: `${BASE_URL}/mypage/created`, + lastModified: new Date(), + changeFrequency: 'daily', + priority: 0.7, + }, + ]; +} From aabb3803f589181fa803b90c2df54183fd7478dd Mon Sep 17 00:00:00 2001 From: chaeney Date: Thu, 17 Oct 2024 16:47:12 +0900 Subject: [PATCH 5/8] =?UTF-8?q?[KAN-135]=20setting:=20=EB=A9=94=ED=83=80?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(main)/mypage/layout.tsx | 4 ++++ src/app/(main)/mypage/review/writable/page.tsx | 7 ------- src/app/(main)/mypage/review/written/page.tsx | 7 ------- src/app/(main)/saved/layout.tsx | 15 +++++++++++++++ src/app/(main)/saved/page.tsx | 3 --- src/utils/makeMetadata.ts | 5 ++++- 6 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 src/app/(main)/saved/layout.tsx diff --git a/src/app/(main)/mypage/layout.tsx b/src/app/(main)/mypage/layout.tsx index 9bf71e6f..2dc99443 100644 --- a/src/app/(main)/mypage/layout.tsx +++ b/src/app/(main)/mypage/layout.tsx @@ -1,8 +1,12 @@ +import { Metadata } from 'next'; import UserProfileLayout from '@/app/components/UserProfileLayout/UserProfileLayout'; import { ReactNode } from 'react'; import Tab from './_component/Tab'; import { getUserData } from '@/app/api/actions/mypage/getUserData'; import { redirect } from 'next/navigation'; +import { pageMetadata } from '@/utils/makeMetadata'; + +export const metadata: Metadata = pageMetadata('나의 리뷰', '/mypage/review'); const Layout = async ({ children, diff --git a/src/app/(main)/mypage/review/writable/page.tsx b/src/app/(main)/mypage/review/writable/page.tsx index ed537397..cbf65f2c 100644 --- a/src/app/(main)/mypage/review/writable/page.tsx +++ b/src/app/(main)/mypage/review/writable/page.tsx @@ -1,6 +1,5 @@ 'use client'; -import { Metadata } from 'next'; import getJoinedGatherings from '@/app/api/actions/gatherings/getJoinedGathering'; import Card from '@/app/components/Card/Card'; import ReviewModal from '@/app/components/Modal/ReviewModal'; @@ -13,12 +12,6 @@ import { queries } from '@/queries'; import useScrollGradientEffect from '@/hooks/useScrollGradientEffect'; import GradientOverlay from '@/app/components/GradientOverlay/GradientOverlay'; import MotionWrapper from '@/app/components/MotionWrapper/MotionWrapper'; -import { pageMetadata } from '@/utils/makeMetadata'; - -export const metadata: Metadata = pageMetadata( - '나의 리뷰', - '/mypage/review/writable', -); const WritableReviewsPage = () => { const [isModalOpen, setIsModalOpen] = useState(false); diff --git a/src/app/(main)/mypage/review/written/page.tsx b/src/app/(main)/mypage/review/written/page.tsx index f9932af4..dcb7f273 100644 --- a/src/app/(main)/mypage/review/written/page.tsx +++ b/src/app/(main)/mypage/review/written/page.tsx @@ -1,16 +1,9 @@ -import { Metadata } from 'next'; import { getUserData } from '@/app/api/actions/mypage/getUserData'; import getReviewList from '@/app/api/actions/reviews/getReviewList'; import { redirect } from 'next/navigation'; import EmptyReviewPage from '../../_component/EmptyReviewPage'; import ReviewFilterTab from '../../_component/ReviewFilterTab'; import ReviewsList from './_component/ReviewsList'; -import { pageMetadata } from '@/utils/makeMetadata'; - -export const metadata: Metadata = pageMetadata( - '나의 리뷰', - '/mypage/review/written', -); const WrittenReviewsPage = async () => { const user = await getUserData(); diff --git a/src/app/(main)/saved/layout.tsx b/src/app/(main)/saved/layout.tsx new file mode 100644 index 00000000..359c3235 --- /dev/null +++ b/src/app/(main)/saved/layout.tsx @@ -0,0 +1,15 @@ +import { Metadata } from 'next'; +import { ReactNode } from 'react'; +import { pageMetadata } from '@/utils/makeMetadata'; + +export const metadata: Metadata = pageMetadata('찜한 모임', '/saved'); + +const Layout = ({ + children, +}: Readonly<{ + children: ReactNode; +}>) => { + return <>{children}; +}; + +export default Layout; diff --git a/src/app/(main)/saved/page.tsx b/src/app/(main)/saved/page.tsx index 5641802e..6950d0dc 100644 --- a/src/app/(main)/saved/page.tsx +++ b/src/app/(main)/saved/page.tsx @@ -10,9 +10,6 @@ import SavedList from './_component/SavedList'; import useSavedGatherings from '@/hooks/useSavedGatherings'; import { useSavedGatheringList } from '@/context/SavedGatheringContext'; import { SORT_OPTIONS } from '@/constants/common'; -import { pageMetadata } from '@/utils/makeMetadata'; - -export const metadata: Metadata = pageMetadata('찜한 모임', '/saved'); const SavedPage = () => { const { savedGatherings } = useSavedGatheringList(); diff --git a/src/utils/makeMetadata.ts b/src/utils/makeMetadata.ts index f6fd356e..fe235e98 100644 --- a/src/utils/makeMetadata.ts +++ b/src/utils/makeMetadata.ts @@ -66,7 +66,10 @@ import { GatheringInfoType } from '@/types/data.type'; export const pageMetadata = (page: string, path: string) => { return { - title: page, + title: { + template: '%s | Soothe With Me', + default: page, + }, description: `Soothe With Me ${page} 페이지입니다.`, openGraph: { title: page, From f3f7b1fee3516ed7a3fdff037a975ed8d556e90f Mon Sep 17 00:00:00 2001 From: chaeney Date: Thu, 17 Oct 2024 16:51:23 +0900 Subject: [PATCH 6/8] =?UTF-8?q?[KAN-135]=20style:=20=EC=B0=9C=ED=95=9C=20?= =?UTF-8?q?=EB=AA=A8=EC=9E=84=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20gap=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(main)/saved/_component/SavedList.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/(main)/saved/_component/SavedList.tsx b/src/app/(main)/saved/_component/SavedList.tsx index cc0d5107..9ad5af4c 100644 --- a/src/app/(main)/saved/_component/SavedList.tsx +++ b/src/app/(main)/saved/_component/SavedList.tsx @@ -35,6 +35,7 @@ const SavedList = ({ dataList }: SavedListProps) => { {dataList.map((item, index) => (
Date: Thu, 17 Oct 2024 17:12:50 +0900 Subject: [PATCH 7/8] =?UTF-8?q?[KAN-135]=20setting:=20=EA=B5=AC=EA=B8=80?= =?UTF-8?q?=20=EB=A9=94=ED=83=80=ED=83=9C=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/makeMetadata.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/makeMetadata.ts b/src/utils/makeMetadata.ts index fe235e98..814eb5e4 100644 --- a/src/utils/makeMetadata.ts +++ b/src/utils/makeMetadata.ts @@ -57,7 +57,7 @@ export const rootMetadata = { canonical: `${process.env.NEXT_PUBLIC_BASE_URL}/gatherings`, }, other: { - 'google-site-verification': '3TzGNrqEDpp12jYWOwKcH92cFxvYmfrz-0lspdNdTwo', + 'google-site-verification': 'EnQi5HcxKKMfPQq_KgrRrnkbL7g2qiHLz6KUXcBtNwo', }, }; From 3f2d410d72ab624f633fdcbe8e5bd158bece7728 Mon Sep 17 00:00:00 2001 From: chaeney Date: Thu, 17 Oct 2024 17:18:58 +0900 Subject: [PATCH 8/8] =?UTF-8?q?[KAN-135]=20chore:=20TODO=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/CardList/CardList.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/components/CardList/CardList.tsx b/src/app/components/CardList/CardList.tsx index 8939008f..30ca586e 100644 --- a/src/app/components/CardList/CardList.tsx +++ b/src/app/components/CardList/CardList.tsx @@ -20,7 +20,6 @@ import Tag from '@/app/components/Tag/Tag'; import InfoChip from '@/app/components/Chip/InfoChip'; import ProgressBar from '@/app/components/ProgressBar/ProgressBar'; -// TODO : optional props를 필수로 변경 interface CardProps { data: GatheringType; isSaved?: boolean;