From 0861d6eb6e88d8594426c3182e2dd0d8368f3a89 Mon Sep 17 00:00:00 2001 From: junseublim Date: Thu, 25 Jul 2024 22:31:42 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20Metadata=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(board)/board/[boardId]/page.tsx | 21 +++++++++++++++++++-- src/app/layout.tsx | 5 +++-- src/app/sitemap.ts | 16 ++++++++++++++++ 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 src/app/sitemap.ts diff --git a/src/app/(board)/board/[boardId]/page.tsx b/src/app/(board)/board/[boardId]/page.tsx index 5f73300..fd72268 100644 --- a/src/app/(board)/board/[boardId]/page.tsx +++ b/src/app/(board)/board/[boardId]/page.tsx @@ -1,11 +1,30 @@ import PolaroidCard from '@/components/Polaroid/PolaroidCard' import { getBoard } from '@/lib' +import { Metadata } from 'next' import CreatePolaroid from './components/CreatePolaroidModal' import { ModalProvider } from './components/CreatePolaroidModal/ModalContext' import Empty from './components/Empty' import BoardHeader from './components/Header' import OpenModalBtn from './components/OpenModalBtn' +export async function generateMetadata({ + params, +}: BoardPageProps): Promise { + const { boardId } = params + const board = await getBoard(boardId) + + return { + openGraph: { + title: board.title, + description: '내 보드를 우리의 소중한 추억들로 꾸며줘!', + }, + twitter: { + title: board.title, + description: '내 보드를 우리의 소중한 추억들로 꾸며줘!', + }, + } +} + interface BoardPageProps { params: { boardId: string @@ -16,8 +35,6 @@ const BoardPage = async ({ params }: BoardPageProps) => { const { boardId } = params const board = await getBoard(boardId) - console.log('>> BOARD: ', board) - return (
diff --git a/src/app/layout.tsx b/src/app/layout.tsx index e55d84a..2261e8e 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -19,8 +19,9 @@ const Hesom = localFont({ }) export const metadata: Metadata = { - title: 'POLABO', - description: '우리만의 추억보드', + title: 'POLABO | 함께 꾸미는 폴라로이드 보드, 폴라보', + description: + '우리의 일상도 특별하게! 소중한 추억들을 공유하며 폴라로이드로 보드를 꾸며봐요.', metadataBase: new URL('https://polabo.site'), openGraph: { images: [ diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts new file mode 100644 index 0000000..c754e92 --- /dev/null +++ b/src/app/sitemap.ts @@ -0,0 +1,16 @@ +import { MetadataRoute } from 'next' + +export default async function sitemap(): Promise { + return [ + { + url: `${process.env.BASE_URL}`, + lastModified: new Date(), + priority: 1, + }, + { + url: `${process.env.BASE_URL}/board/create`, + lastModified: new Date(), + priority: 0.8, + }, + ] +} From e688afa4a7c7406b129f0037496ad453d9a37040 Mon Sep 17 00:00:00 2001 From: junseublim Date: Thu, 25 Jul 2024 22:42:35 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20NEXT=5FPUBLIC=5FGA=5FID=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cicd.yml | 4 +++- src/app/sitemap.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index c80bcbb..d9ca78b 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -13,7 +13,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Set .ENV file - run: echo "API_HOST=${{ secrets.API_HOST }}" > .env + run: | + echo "API_HOST=${{ secrets.API_HOST }}" >> .env + echo "NEXT_PUBLIC_GA_ID=${{ secrets.PUBLIC_GA_ID }}" >> .env - name: Build docker image run: docker build -t sonny2024/polabo-fe . - name: Login to DockerHub diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts index c754e92..0e7bdf9 100644 --- a/src/app/sitemap.ts +++ b/src/app/sitemap.ts @@ -3,12 +3,12 @@ import { MetadataRoute } from 'next' export default async function sitemap(): Promise { return [ { - url: `${process.env.BASE_URL}`, + url: `https://polabo.site`, lastModified: new Date(), priority: 1, }, { - url: `${process.env.BASE_URL}/board/create`, + url: `https://polabo.site/board/create`, lastModified: new Date(), priority: 0.8, },