Skip to content

chore: update meta #587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions frontend/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'react-toastify/dist/ReactToastify.min.css'
import '@/utils/logoAnimation.css'
import NextTopLoader from 'nextjs-toploader'
import { Metadata } from 'next'
import { getHostname } from '@/utils/appConfig'

const inter = Inter({
weight: 'variable',
Expand All @@ -21,10 +22,37 @@ const jetbrains_mono = JetBrains_Mono({
variable: '--font-jetbrains-mono',
})

const host = getHostname()

const title = 'Phase Console'
const description = 'Application secrets and configuration management for developers.'

// TODO: Set metadata for specific page routes
export const metadata: Metadata = {
title: 'Phase Console',
description: 'Open source secrets manager',
title,
description,
openGraph: {
title,
description,
url: host,
siteName: 'Phase',
images: [
{
url: `${host}/assets/images/meta.png`,
width: 1200,
height: 675,
alt: title,
},
],
locale: 'en_US',
type: 'website',
},
twitter: {
card: 'summary_large_image',
title,
description,
images: [`${host}/assets/images/meta.png`],
},
}

export default function RootLayout({ children }: { children: React.ReactNode }) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export const config = {
* - _next/image (image optimization files)
* - favicon.ico (favicon file)
*/
'/((?!api|_next/static|_next/image|favicon.ico|favicon.svg|login|lockbox|api/health).*)',
'/((?!api|_next/static|_next/image|favicon.ico|favicon.svg|assets|login|lockbox|api/health).*)',
],
}
Binary file added frontend/public/assets/images/meta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion frontend/utils/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@ export const isCloudHosted = () => {
)
}

export const getHostname = () => `${window.location.protocol}//${window.location.host}`
export const getHostname = () => {
if (typeof window !== 'undefined') {
// Client-side: use window.location
return `${window.location.protocol}//${window.location.host}`
}

// Server-side: use NEXTAUTH_URL environment variable
return process.env.NEXTAUTH_URL
? `${process.env.NEXTAUTH_URL}`
: ''
}


export const getApiHost = () => {
return isCloudHosted() ? 'https://api.phase.dev' : `${getHostname()}/service/public`
Expand Down