Skip to content

Commit

Permalink
update metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
maxaleks committed Sep 18, 2024
1 parent db643f4 commit 574424c
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,36 @@ import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import './globals.css';
import Script from 'next/script';
import { headers } from 'next/headers';

const inter = Inter({ subsets: ['latin'] });

export const metadata: Metadata = {
title: 'Swapscout',
description: 'Swap between chains fast and easy. Powered by Blockscout',
icons: [
{ rel: 'icon', url: '/favicon-32x32.png', sizes: '32x32', type: 'image/png' },
{ rel: 'apple-touch-icon', url: '/favicon-256x256.png' },
],
openGraph: {
export async function generateMetadata(): Promise<Metadata> {
const headersList = headers();
const host = headersList.get('host') || 'localhost:3000';
const protocol = process.env.NODE_ENV === 'production' ? 'https' : 'http';
const baseUrl = `${protocol}://${host}`;

return {
title: 'Swapscout',
description: 'Swap between chains fast and easy. Powered by Blockscout',
images: [{ url: '/og-image.png', width: 1200, height: 600 }],
type: 'website',
},
icons: [
{ rel: 'icon', url: '/favicon-32x32.png', sizes: '32x32', type: 'image/png' },
{ rel: 'apple-touch-icon', url: '/favicon-256x256.png' },
],
openGraph: {
title: 'Swapscout',
description: 'Swap between chains fast and easy. Powered by Blockscout',
images: [
{
url: `${baseUrl}/og-image.png`,
width: 1200,
height: 600,
},
],
type: 'website',
},
};
};

const GoogleAnalytics = () => {
Expand Down

0 comments on commit 574424c

Please sign in to comment.