Skip to content

Commit

Permalink
Merge pull request #62 from DDD-Community/feature/metadata
Browse files Browse the repository at this point in the history
[Feature/Metadata] Metadata 설정
  • Loading branch information
junseublim authored Jul 25, 2024
2 parents 9a449e6 + e688afa commit b5fb0b4
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 19 additions & 2 deletions src/app/(board)/board/[boardId]/page.tsx
Original file line number Diff line number Diff line change
@@ -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<Metadata> {
const { boardId } = params
const board = await getBoard(boardId)

return {
openGraph: {
title: board.title,
description: '내 보드를 우리의 소중한 추억들로 꾸며줘!',
},
twitter: {
title: board.title,
description: '내 보드를 우리의 소중한 추억들로 꾸며줘!',
},
}
}

interface BoardPageProps {
params: {
boardId: string
Expand All @@ -16,8 +35,6 @@ const BoardPage = async ({ params }: BoardPageProps) => {
const { boardId } = params
const board = await getBoard(boardId)

console.log('>> BOARD: ', board)

return (
<div className="relative flex h-dvh flex-col bg-gray-50">
<BoardHeader name={board.title} />
Expand Down
5 changes: 3 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
16 changes: 16 additions & 0 deletions src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { MetadataRoute } from 'next'

export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
return [
{
url: `https://polabo.site`,
lastModified: new Date(),
priority: 1,
},
{
url: `https://polabo.site/board/create`,
lastModified: new Date(),
priority: 0.8,
},
]
}

0 comments on commit b5fb0b4

Please sign in to comment.