feat: extract hardcoded branding values to env vars

This commit is contained in:
2026-06-26 00:34:04 +04:00
parent f2d03ebec6
commit 9cbb5e3d23
12 changed files with 133 additions and 96 deletions
+2 -2
View File
@@ -53,11 +53,11 @@ export async function generateMetadata(props) {
type: 'website'
},
twitter: {
site: '@OrganisationKA',
site: `@${process.env.NEXT_PUBLIC_TWITTER_USERNAME || 'OrganisationKA'}`,
card: 'summary_large_image',
title,
description,
creator: '@OrganisationKA',
creator: `@${process.env.NEXT_PUBLIC_TWITTER_USERNAME || 'OrganisationKA'}`,
images: {
url: `${apiUrl}${kuvetiFormat?.url}`,
alt: `Couverture ${title}`,
+14 -10
View File
@@ -4,17 +4,21 @@ import {jwennTeks} from '../../lib/oki-api'
import TeksDrawer from '../../components/teks/teks-drawer'
import Loading from './loading'
const siteName = process.env.NEXT_PUBLIC_SITE_NAME || 'PAWÒL-NU. Paroles et traductions.'
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://pawol.nu'
const twitterHandle = `@${process.env.NEXT_PUBLIC_TWITTER_USERNAME || 'OrganisationKA'}`
export const metadata = {
title: 'PAWÒL-NU. Paroles et traductions.',
title: siteName,
description: 'Retrouvez les paroles et les traductions de vos chansons préférées.',
openGraph: {
title: 'PAWÒL-NU. Paroles et traductions.',
title: siteName,
description: 'Retrouvez les paroles et les traductions de vos chansons préférées.',
url: 'https://pawol.nu/paroles',
siteName: 'PAWÒL-NU. Paroles et traductions.',
url: `${siteUrl}/paroles`,
siteName,
images: [
{
url: 'https://pawol.nu/logo-512x512.png',
url: `${siteUrl}/logo-512x512.png`,
width: 512,
height: 512
}
@@ -23,14 +27,14 @@ export const metadata = {
type: 'website'
},
twitter: {
site: '@OrganisationKA',
site: twitterHandle,
card: 'summary_large_image',
title: 'PAWÒL-NU. Paroles et traductions.',
title: siteName,
description: 'Retrouvez les paroles et les traductions de vos chansons préférées.',
creator: '@OrganisationKA',
creator: twitterHandle,
images: {
url: 'https://pawol.nu/logo-512x512.png',
alt: 'OKI Logo',
url: `${siteUrl}/logo-512x512.png`,
alt: `${siteName} Logo`,
},
}
}
+8 -6
View File
@@ -8,6 +8,8 @@ import Footer from '../../components/footer'
const apiUrl = process.env.NEXT_PUBLIC_API_URL_ROOT || 'http://localhost:1337'
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3000'
const siteName = process.env.NEXT_PUBLIC_SITE_NAME || 'PAWÒL-NU. Paroles et traductions.'
const twitterHandle = `@${process.env.NEXT_PUBLIC_TWITTER_USERNAME || 'OrganisationKA'}`
async function jwennDone() {
const denyeTeks = await jwennDenyeTeks()
@@ -29,23 +31,23 @@ export async function generateMetadata() {
const description = `Derniers morceaux : ${songList}`
return {
title: 'PAWÒL-NU | Derniers morceaux',
title: `${siteName} | Derniers morceaux`,
description,
openGraph: {
title: 'PAWÒL-NU | Derniers morceaux',
title: `${siteName} | Derniers morceaux`,
description,
url: `${siteUrl}/paroles`,
siteName: 'PAWÒL-NU. Paroles et traductions.',
siteName,
images: [{url: imageUrl, width: imageWidth, height: imageHeight}],
locale: 'fr_FR',
type: 'website',
},
twitter: {
site: '@OrganisationKA',
site: twitterHandle,
card: 'summary_large_image',
title: 'PAWÒL-NU | Derniers morceaux',
title: `${siteName} | Derniers morceaux`,
description,
creator: '@OrganisationKA',
creator: twitterHandle,
images: {url: imageUrl, alt: 'Couverture du dernier morceau publié'},
},
}