From d86dc7283a3c150abb538a953c3cdad749cbe60b Mon Sep 17 00:00:00 2001 From: seondal Date: Sun, 10 Sep 2023 04:53:34 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=8C=90=20seo=20:=20=20=EB=94=94?= =?UTF-8?q?=ED=85=8C=EC=9D=BC=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=8F=99?= =?UTF-8?q?=EC=A0=81=EC=9C=BC=EB=A1=9C=20=EB=A9=94=ED=83=80=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(Sub)/detail/[id]/page.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/(Sub)/detail/[id]/page.tsx b/src/app/(Sub)/detail/[id]/page.tsx index 7e940de0..6d6cd200 100644 --- a/src/app/(Sub)/detail/[id]/page.tsx +++ b/src/app/(Sub)/detail/[id]/page.tsx @@ -1,8 +1,20 @@ +import { Metadata, ResolvingMetadata } from 'next'; import DetailHeader from './components/DetailHeader'; import DetailSection from './components/DetailSection'; import { getPoseDetail } from '@/apis'; import { HydrationProvider } from '@/components/Provider/HydrationProvider'; +export async function generateMetadata({ params }: { params: { id: string } }): Promise { + const id = parseInt(params.id); + const { + poseInfo: { peopleCount, frameCount, tagAttributes }, + } = await getPoseDetail(id); + const description = `${tagAttributes},${frameCount}컷,${peopleCount}인 포즈추천`; + return { + description, + }; +} + export default function DetailPage({ params }: { params: { id: number } }) { const { id } = params; From be3736c1fcfe8fa7d62bc41185354cf8b6ed7f22 Mon Sep 17 00:00:00 2001 From: seondal Date: Sun, 10 Sep 2023 04:53:46 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=8C=90=20seo=20:=20=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=EB=B3=84=20meta=20description?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(Main)/feed/page.tsx | 1 + src/app/(Main)/pick/page.tsx | 1 + src/app/(Main)/talk/page.tsx | 1 + src/app/(Sub)/detail/[id]/page.tsx | 3 +++ src/app/layout.tsx | 24 ++++++++++++------------ 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/app/(Main)/feed/page.tsx b/src/app/(Main)/feed/page.tsx index b4bd3ad6..34709ba8 100644 --- a/src/app/(Main)/feed/page.tsx +++ b/src/app/(Main)/feed/page.tsx @@ -3,6 +3,7 @@ import FeedSection from './FeedSection'; export const metadata: Metadata = { title: '포즈피드', + description: '포즈피드에서 조건에 맞는 포즈를 찾고, 친구한테 공유해보세요', }; export default function Feed() { diff --git a/src/app/(Main)/pick/page.tsx b/src/app/(Main)/pick/page.tsx index 98a579fe..b97e3cbe 100644 --- a/src/app/(Main)/pick/page.tsx +++ b/src/app/(Main)/pick/page.tsx @@ -3,6 +3,7 @@ import { Metadata } from 'next'; export const metadata: Metadata = { title: '포즈픽', + description: '시간 없을 땐 포즈픽으로 빠르게 랜덤 포즈를 추천받아보세요.', }; export default function Pick() { diff --git a/src/app/(Main)/talk/page.tsx b/src/app/(Main)/talk/page.tsx index 06a11046..82402475 100644 --- a/src/app/(Main)/talk/page.tsx +++ b/src/app/(Main)/talk/page.tsx @@ -5,6 +5,7 @@ import { Metadata } from 'next'; export const metadata: Metadata = { title: '포즈톡', + description: '포즈톡에서 뽑은 랜덤 제시어로 나만의 개성있는 포즈를 완성해보세요.', }; export default function Talk() { diff --git a/src/app/(Sub)/detail/[id]/page.tsx b/src/app/(Sub)/detail/[id]/page.tsx index 6d6cd200..627f746f 100644 --- a/src/app/(Sub)/detail/[id]/page.tsx +++ b/src/app/(Sub)/detail/[id]/page.tsx @@ -12,6 +12,9 @@ export async function generateMetadata({ params }: { params: { id: string } }): const description = `${tagAttributes},${frameCount}컷,${peopleCount}인 포즈추천`; return { description, + openGraph: { + description: '이 포즈는 어때요?', + }, }; } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 56952157..d4f5e5f9 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -12,17 +12,17 @@ import RecoilContextProvider from '@/provider/RecoilContextProvider'; import type { Metadata } from 'next'; -const DEFAULT_OG_TITLE = 'PosePicker'; -const DEFAULT_OG_DESC = '다음 포즈 뭐하지? 포즈피커가 포즈 고민을 해결해 드릴게요!'; -const DEFAULT_OG_IMAGE = '/images/main_star.png'; +const META_TITLE = 'PosePicker'; +const META_DESCRIPTION = '다음 포즈 뭐하지? 포즈피커가 포즈고민을 해결해 드릴게요!'; +const META_OG_IMAGE = '/images/main_star.png'; export const metadata: Metadata = { metadataBase: new URL(BASE_SITE_URL), title: { - default: DEFAULT_OG_TITLE, - template: `${DEFAULT_OG_TITLE} | %s`, + default: `${META_TITLE} - 포즈피커`, + template: `${META_TITLE} | %s`, }, - description: '다음 포즈 뭐하지? 포즈피커의 포즈 추천으로 포즈 고민을 해결해 드릴게요!', + description: META_DESCRIPTION, verification: { google: 'MB7qV_Oa4G4gR0jHgjtnE6S4g4blocE2mjo7z-z2f6Q', }, @@ -30,14 +30,14 @@ export const metadata: Metadata = { 'naver-site-verification': '65f3aba9349cce28018ac7a97d4f87ff00709aa3', }, openGraph: { - title: DEFAULT_OG_TITLE, - description: DEFAULT_OG_DESC, - images: [DEFAULT_OG_IMAGE], + title: META_TITLE, + description: META_DESCRIPTION, + images: [META_OG_IMAGE], }, twitter: { - title: DEFAULT_OG_TITLE, - description: DEFAULT_OG_DESC, - images: [DEFAULT_OG_IMAGE], + title: META_TITLE, + description: META_DESCRIPTION, + images: [META_OG_IMAGE], }, viewport: { width: 'device-width', From 1694374dd639910266d78305bcdf8a9064f60a0f Mon Sep 17 00:00:00 2001 From: seondal Date: Sun, 10 Sep 2023 05:20:17 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=8C=90=20seo=20:=20=20=EC=82=AC?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8=EB=A7=B5=20=EB=8F=99=EC=A0=81=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(Sub)/detail/[id]/page.tsx | 8 +++++++- src/app/sitemap.ts | 22 ++++++++++++++++++++ src/app/sitemap.xml | 33 ------------------------------ src/constants/url.ts | 1 + 4 files changed, 30 insertions(+), 34 deletions(-) create mode 100644 src/app/sitemap.ts delete mode 100644 src/app/sitemap.xml diff --git a/src/app/(Sub)/detail/[id]/page.tsx b/src/app/(Sub)/detail/[id]/page.tsx index 627f746f..b707591e 100644 --- a/src/app/(Sub)/detail/[id]/page.tsx +++ b/src/app/(Sub)/detail/[id]/page.tsx @@ -4,15 +4,21 @@ import DetailSection from './components/DetailSection'; import { getPoseDetail } from '@/apis'; import { HydrationProvider } from '@/components/Provider/HydrationProvider'; -export async function generateMetadata({ params }: { params: { id: string } }): Promise { +export async function generateMetadata( + { params }: { params: { id: string } }, + parent: ResolvingMetadata +): Promise { const id = parseInt(params.id); const { poseInfo: { peopleCount, frameCount, tagAttributes }, } = await getPoseDetail(id); const description = `${tagAttributes},${frameCount}컷,${peopleCount}인 포즈추천`; + const defaultOgTitle = (await parent).openGraph?.title; + return { description, openGraph: { + title: defaultOgTitle, description: '이 포즈는 어때요?', }, }; diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts new file mode 100644 index 00000000..327642e0 --- /dev/null +++ b/src/app/sitemap.ts @@ -0,0 +1,22 @@ +import { getPoseFeed } from '@/apis'; +import { URL } from '@/constants/url'; + +export default async function sitemap() { + const baseUrl = URL.site; + + const { + filteredContents: { content }, + } = await getPoseFeed(0, 0, '', 0); + const detailUrls = content.map(({ poseInfo }) => ({ + url: `${baseUrl}/detail/${poseInfo.poseId}`, + lastModified: poseInfo.updatedAt, + })); + + return [ + { url: baseUrl, lastModified: new Date() }, + { url: `${baseUrl}/pick`, lastModified: new Date() }, + { url: `${baseUrl}/talk`, lastModified: new Date() }, + { url: `${baseUrl}/feed`, lastModified: new Date() }, + ...detailUrls, + ]; +} diff --git a/src/app/sitemap.xml b/src/app/sitemap.xml deleted file mode 100644 index 0e720390..00000000 --- a/src/app/sitemap.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - https://www.posepicker.site/pick - 2023-09-08T15:55:51+00:00 - 1.00 - - - https://www.posepicker.site/menu - 2023-09-08T15:55:51+00:00 - 0.80 - - - https://www.posepicker.site/talk - 2023-09-08T15:55:51+00:00 - 0.80 - - - https://www.posepicker.site/feed - 2023-09-08T15:55:51+00:00 - 0.80 - - - https://www.posepicker.site/bookmark - 2023-09-08T15:55:51+00:00 - 0.80 - - - https://www.posepicker.site/detail/undefined - 2023-09-08T15:55:51+00:00 - 0.64 - - \ No newline at end of file diff --git a/src/constants/url.ts b/src/constants/url.ts index 335b3f38..0313fdba 100644 --- a/src/constants/url.ts +++ b/src/constants/url.ts @@ -1,4 +1,5 @@ export const URL = { + site: 'https://www.posepicker.site', inquiry: 'https://docs.google.com/forms/d/e/1FAIpQLSeZuPZTXnO4rZ4k39SzXv96PWAW4gLcTYBrsRUrgRHSVV9Ldg/viewform?usp=sf_link', };