Standardize meta descriptions by introducing OG_DESCRIPTION constant

This commit is contained in:
MartinBraquet
2026-07-24 20:28:20 +02:00
parent 9ab38056ab
commit 381a6a0b7a
4 changed files with 10 additions and 7 deletions

View File

@@ -45,3 +45,6 @@ export type Locale = (typeof supportedLocales)[number]
export type LocaleTuple = {
[K in keyof typeof LOCALES]: [K, (typeof LOCALES)[K]]
}[keyof typeof LOCALES]
export const OG_DESCRIPTION =
'The free directory to find your people — fully searchable by values and demographics. No ads, no swipes.'

View File

@@ -1,4 +1,5 @@
import {JSONContent} from '@tiptap/core'
import {OG_DESCRIPTION} from 'common/constants'
import {RESERVED_PATHS} from 'common/envs/constants'
import {debug} from 'common/logger'
import {getProfileOgImageUrl} from 'common/profiles/og-image'
@@ -302,7 +303,7 @@ function UserPageInner(props: ActiveUserPageProps) {
description={
profile?.headline ||
parseJsonContentToText(profile?.bio as JSONContent)?.slice(0, 250) ||
`${user.name} is on Compass`
OG_DESCRIPTION
}
url={`/${user.username}`}
image={seoImage}

View File

@@ -7,6 +7,7 @@ import {Keyboard} from '@capacitor/keyboard'
import {StatusBar} from '@capacitor/status-bar'
import * as Sentry from '@sentry/node'
import clsx from 'clsx'
import {OG_DESCRIPTION} from 'common/constants'
import {DEPLOYED_WEB_URL} from 'common/envs/constants'
import {IS_VERCEL, OG_CARD} from 'common/hosting/constants'
import {debug} from 'common/logger'
@@ -218,15 +219,13 @@ function MyApp(props: AppProps<PageProps>) {
}, [])
const title = 'Compass'
const description =
'The free directory for finding your people — fully searchable by values and demographics. No ads, no swipes.'
return (
<>
<Head>
<title>{title}</title>
<meta name="description" content={description} key="description" />
<meta name="description" content={OG_DESCRIPTION} key="description" />
{/*OG tags (WhatsApp, Facebook, etc.). These are the site-wide default: any page that
renders <SEO> overrides them by `key`, and pages that don't (the home page among them)
@@ -237,7 +236,7 @@ function MyApp(props: AppProps<PageProps>) {
<meta property="og:site_name" content="Compass" />
<meta property="og:type" content="website" key="og-type" />
<meta property="og:title" content={title} key="og-title" />
<meta property="og:description" content={description} key="og-description" />
<meta property="og:description" content={OG_DESCRIPTION} key="og-description" />
<meta property="og:url" content={DEPLOYED_WEB_URL} key="og-url" />
<meta property="og:image" content={OG_CARD.url} key="og-image" />
<meta property="og:image:secure_url" content={OG_CARD.url} key="og-image-secure-url" />

View File

@@ -17,7 +17,7 @@ import {
} from '@heroicons/react/24/outline'
import {GlobeAltIcon} from '@heroicons/react/24/solid'
import clsx from 'clsx'
import {discordLink, formLink, githubRepo} from 'common/constants'
import {discordLink, formLink, githubRepo, OG_DESCRIPTION} from 'common/constants'
import {DEPLOYED_WEB_URL} from 'common/envs/constants'
import Link from 'next/link'
import {ComponentType, ReactNode, SVGProps, useState} from 'react'
@@ -632,7 +632,7 @@ export default function About() {
<PageBase trackPageView={'about'}>
<SEO
title={t('about.seo.title', 'About')}
description={t('about.seo.description', 'About Compass')}
description={t('about.seo.description', OG_DESCRIPTION)}
url="/about"
/>