Add dynamic page title support to NoSEO component and update notifications page usage

This commit is contained in:
MartinBraquet
2026-04-09 12:21:17 +02:00
parent a318f972fc
commit c6c9d5b7b5
3 changed files with 7 additions and 4 deletions

View File

@@ -1,9 +1,13 @@
import {endTitle} from 'common/envs/constants'
import Head from 'next/head'
/** Exclude page from search results */
export function NoSEO() {
export function NoSEO(props: {title?: string}) {
let title = props.title ? props.title + ' | ' : ''
title += endTitle
return (
<Head>
<title>{title}</title>
<meta name="robots" content="noindex,follow" />
</Head>
)

View File

@@ -1,4 +1,4 @@
import {IS_PROD} from 'common/envs/constants'
import {endTitle} from 'common/envs/constants'
import {removeUndefinedProps} from 'common/util/object'
import {buildOgUrl} from 'common/util/og'
import Head from 'next/head'
@@ -16,7 +16,6 @@ export function SEO<P extends Record<string, string | undefined>>(props: {
image ?? (ogProps && buildOgUrl(removeUndefinedProps(ogProps.props) as any, ogProps.endpoint))
const absUrl = 'https://compassmeet.com' + url
const endTitle = IS_PROD ? 'Compass' : 'Compass dev'
return (
<Head>

View File

@@ -22,7 +22,7 @@ export default function NotificationsPage() {
return (
<PageBase trackPageView={'notifications page'} className={'mx-4'}>
<NoSEO />
<NoSEO title={t('notifications.title', 'Updates')} />
<Title>{t('notifications.title', 'Updates')}</Title>
<UncontrolledTabs
name={'notifications-page'}