Skip to content

Commit

Permalink
feat(fe): add metadata base option (#1156)
Browse files Browse the repository at this point in the history
  • Loading branch information
dayongkr authored Jan 14, 2024
1 parent 6a4dfea commit be6c3a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
if: ${{ matrix.target == 'frontend-client' }}
run: |
echo "NEXT_PUBLIC_BASEURL=https://dev.codedang.com/api" >> frontend-client/.env
echo "NEXT_URL=https://dev.codedang.com" >> frontend-client/.env
# If target is backend-admin, run `pnpm --filter backend build admin`
# For other targets, run `pnpm --filter <target> build`
Expand Down
4 changes: 3 additions & 1 deletion frontend-client/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { cn } from '@/lib/utils'
import { metaBaseUrl } from '@/lib/vars'
import type { Metadata, Viewport } from 'next'
import { Manrope, Noto_Sans_KR } from 'next/font/google'
import './globals.css'
Expand All @@ -19,7 +20,8 @@ const manrope = Manrope({

export const metadata: Metadata = {
title: 'Codedang 코드당',
description: 'Codedang, Online Judge for SKKU'
description: 'Codedang, Online Judge for SKKU',
metadataBase: metaBaseUrl ? new URL(metaBaseUrl) : null
}

export const viewport: Viewport = {
Expand Down
1 change: 1 addition & 0 deletions frontend-client/lib/vars.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const baseUrl = process.env.NEXT_PUBLIC_BASEURL
export const metaBaseUrl = process.env.VERCEL_URL || process.env.NEXT_URL

0 comments on commit be6c3a6

Please sign in to comment.