From dc330a966ef6fb8a50af1607e2fcf737d1ee011b Mon Sep 17 00:00:00 2001 From: 0xtxbi Date: Thu, 27 Feb 2025 12:41:49 +0100 Subject: [PATCH 1/7] add app config --- airdrops/src/config/app.ts | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 airdrops/src/config/app.ts diff --git a/airdrops/src/config/app.ts b/airdrops/src/config/app.ts new file mode 100644 index 00000000000..3b75f8bdbe6 --- /dev/null +++ b/airdrops/src/config/app.ts @@ -0,0 +1,41 @@ +/** + * Configuration for the airdrops website + */ +const STATIC_SITE_URL = 'https://unlock-protocol.com' + +export const config = { + // Base URL for the airdrops website + baseUrl: 'https://airdrops.unlock-protocol.com', + + // Static site URL + staticSiteUrl: STATIC_SITE_URL, + + // Dashboard URL + dashboardUrl: 'https://app.unlock-protocol.com', + + // App name and branding + appName: { + default: 'Airdrops', + full: 'Unlock Airdrops', + brand: 'Unlock Protocol', + }, + + // Metadata descriptions + descriptions: { + default: + 'The Unlock Protocol belongs to its community of creators, developers, and users. Contribute code, docs, or just use the protocol and claim UP tokens.', + }, + + // Images + images: { + default: `${STATIC_SITE_URL}/images/unlock.png`, + thumbnail: `${STATIC_SITE_URL}/images/unlock.png`, + favicon: '/favicon.ico', + }, + + // Social media handles + social: { + twitter: '@UnlockProtocol', + github: 'unlock-protocol', + }, +} From e4d4df035322b358796870bc47cbb8ac33ebfa2b Mon Sep 17 00:00:00 2001 From: 0xtxbi Date: Thu, 27 Feb 2025 12:42:15 +0100 Subject: [PATCH 2/7] add seo config --- airdrops/src/config/seo.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 airdrops/src/config/seo.ts diff --git a/airdrops/src/config/seo.ts b/airdrops/src/config/seo.ts new file mode 100644 index 00000000000..0f3b8c87ae3 --- /dev/null +++ b/airdrops/src/config/seo.ts @@ -0,0 +1,28 @@ +import { Metadata } from 'next' +import { config } from './app' + +// Shared metadata configuration for SEO +export const SHARED_METADATA: Metadata = { + title: { + default: config.appName.default, + template: `%s | ${config.appName.brand}`, + }, + description: config.descriptions.default, + openGraph: { + type: 'website', + locale: 'en_US', + url: config.baseUrl, + siteName: config.appName.default, + images: [ + { + url: config.images.default, + alt: config.appName.full, + }, + ], + }, + twitter: { + card: 'summary_large_image', + site: config.social.twitter, + creator: config.social.twitter, + }, +} From 7470af0ffff5f2bfb6c437fa04793ed0f1d14fc3 Mon Sep 17 00:00:00 2001 From: 0xtxbi Date: Thu, 27 Feb 2025 12:42:57 +0100 Subject: [PATCH 3/7] update header and footer links --- airdrops/components/layout/Footer.tsx | 5 +++-- airdrops/components/layout/Header.tsx | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/airdrops/components/layout/Footer.tsx b/airdrops/components/layout/Footer.tsx index d2706d58297..09ab39801b3 100644 --- a/airdrops/components/layout/Footer.tsx +++ b/airdrops/components/layout/Footer.tsx @@ -1,4 +1,5 @@ import Link from 'next/link' +import { config } from '../../src/config/app' export default function Footer() { return ( @@ -8,7 +9,7 @@ export default function Footer() {
Date: Thu, 27 Feb 2025 12:43:26 +0100 Subject: [PATCH 4/7] update root layout --- airdrops/app/layout.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/airdrops/app/layout.tsx b/airdrops/app/layout.tsx index 2153879683a..368b6bfd251 100644 --- a/airdrops/app/layout.tsx +++ b/airdrops/app/layout.tsx @@ -4,6 +4,8 @@ import { Metadata } from 'next' import RootHeader from '../components/layout/Header' import Providers from './providers' import Footer from '../components/layout/Footer' +import { SHARED_METADATA } from '../src/config/seo' +import { config } from '../src/config/app' const inter = Inter({ subsets: ['latin'], @@ -13,8 +15,9 @@ const inter = Inter({ }) export const metadata: Metadata = { + ...SHARED_METADATA, icons: { - icon: '/favicon.ico', + icon: config.images.favicon, }, } From cf0c41c0bc2e10b04a055c35677f0c392636c8e9 Mon Sep 17 00:00:00 2001 From: 0xtxbi Date: Thu, 27 Feb 2025 12:48:31 +0100 Subject: [PATCH 5/7] update index page --- airdrops/app/page.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/airdrops/app/page.tsx b/airdrops/app/page.tsx index 4d269b21aed..87fb7a5a0a0 100644 --- a/airdrops/app/page.tsx +++ b/airdrops/app/page.tsx @@ -1,5 +1,20 @@ import Campaigns from '../components/Campaigns' import Hero from '../components/Hero' +import { Metadata } from 'next' +import { config } from '../src/config/app' + +export const metadata: Metadata = { + title: `${config.appName.default} | ${config.appName.brand}`, + description: config.descriptions.default, + openGraph: { + title: `${config.appName.default} | ${config.appName.brand}`, + description: config.descriptions.default, + }, + twitter: { + title: `${config.appName.default} | ${config.appName.brand}`, + description: config.descriptions.default, + }, +} export default function Home() { return ( From 15cd518e8d869510547d6f344f6db811ca970efd Mon Sep 17 00:00:00 2001 From: 0xtxbi Date: Thu, 27 Feb 2025 12:48:38 +0100 Subject: [PATCH 6/7] update index page --- airdrops/app/page.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/airdrops/app/page.tsx b/airdrops/app/page.tsx index 87fb7a5a0a0..cc82faa6bc7 100644 --- a/airdrops/app/page.tsx +++ b/airdrops/app/page.tsx @@ -5,15 +5,6 @@ import { config } from '../src/config/app' export const metadata: Metadata = { title: `${config.appName.default} | ${config.appName.brand}`, - description: config.descriptions.default, - openGraph: { - title: `${config.appName.default} | ${config.appName.brand}`, - description: config.descriptions.default, - }, - twitter: { - title: `${config.appName.default} | ${config.appName.brand}`, - description: config.descriptions.default, - }, } export default function Home() { From 199f84eb28efc8e7bcbfaccd072fc67541430941 Mon Sep 17 00:00:00 2001 From: 0xtxbi Date: Thu, 27 Feb 2025 12:48:55 +0100 Subject: [PATCH 7/7] update campaign page --- airdrops/app/campaigns/[campaign]/page.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/airdrops/app/campaigns/[campaign]/page.tsx b/airdrops/app/campaigns/[campaign]/page.tsx index b39283350a4..6e391dd9e09 100644 --- a/airdrops/app/campaigns/[campaign]/page.tsx +++ b/airdrops/app/campaigns/[campaign]/page.tsx @@ -2,6 +2,7 @@ import { notFound } from 'next/navigation' import CampaignDetailContent from '../../../components/CampaignDetailContent' import airdrops from '../../../src/airdrops.json' import { Metadata } from 'next' +import { config } from '../../../src/config/app' export interface CampaignDetailPageProps { params: { @@ -16,21 +17,19 @@ export async function generateMetadata({ if (!campaign) { return { - title: 'Campaign Not Found | Airdrops', - description: 'The requested campaign could not be found.', + title: `Campaign Not Found | ${config.appName.default}`, } } return { - title: `${campaign.name} | Airdrops`, + title: `${campaign.name} | ${config.appName.default}`, description: campaign.description, openGraph: { - title: `${campaign.name} | Airdrops`, + title: `${campaign.name} | ${config.appName.default}`, description: campaign.description, }, twitter: { - card: 'summary', - title: `${campaign.name} | Airdrops`, + title: `${campaign.name} | ${config.appName.default}`, description: campaign.description, }, }