Skip to content

Commit 0eaecf6

Browse files
authored
Merge branch 'develop' into main
2 parents 2605a95 + db0217c commit 0eaecf6

File tree

4 files changed

+66
-2
lines changed

4 files changed

+66
-2
lines changed

next.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,32 @@ const nextConfig = {
5757
},
5858
async rewrites() {
5959
return [
60+
// Rewrite vault detail pages for bots to SSR endpoint
61+
{
62+
source: '/vaults/:vaultAddress/details',
63+
destination: '/api/ssr/vaults/:vaultAddress',
64+
has: [
65+
{
66+
type: 'header',
67+
key: 'User-Agent',
68+
value:
69+
'(facebook|twitter|linkedin|telegram|discord|bot|crawl|spider|facebookexternalhit|Facebot|Twitterbot|TelegramBot|XtilesBot)',
70+
},
71+
],
72+
},
73+
// Also handle wallet-prefixed vault URLs for bots
74+
{
75+
source: '/wallets/:wallet/vaults/:vaultAddress/details',
76+
destination: '/api/ssr/vaults/:vaultAddress',
77+
has: [
78+
{
79+
type: 'header',
80+
key: 'User-Agent',
81+
value:
82+
'(facebook|twitter|linkedin|telegram|discord|bot|crawl|spider|facebookexternalhit|Facebot|Twitterbot|TelegramBot|XtilesBot)',
83+
},
84+
],
85+
},
6086
// Rewrite frontend routes for non-bot user agents (excluding API routes)
6187
{
6288
source: '/((?!api|_next|favicon).*)',

src/components/common/PageMetadata.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ function PageMetadata() {
2828
<link color='#dd5b65' href='/safari-pinned-tab.svg' rel='mask-icon' />
2929
<meta content='index,follow' name='robots' />
3030
<meta content='summary_large_image' name='twitter:card' />
31-
<meta content='Mars Protocol' name='twitter:title' />
31+
<meta content={metadata.title} name='twitter:title' />
32+
<meta content={metadata.description} name='twitter:description' />
3233
<meta content='@mars_protocol' name='twitter:site' />
3334
<meta content='@mars_protocol' name='twitter:creator' />
3435
<meta content='https://app.marsprotocol.io' property='og:url' />
35-
<meta content='https://app.marsprotocol.io/banner.jpg' property='og:image' />
36+
<meta content={metadata.ogImage} property='og:image' />
37+
<meta content={metadata.ogImage} name='twitter:image' />
3638
<meta content='Mars Protocol' property='og:site_name' />
3739
<meta content='#ffffff' name='msapplication-TileColor' />
3840
<meta content='#ffffff' name='theme-color' />

src/constants/pageMetadata.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,67 @@ const PAGE_METADATA = {
55
"Trade spot, margin and perps, lend, and earn on the Cosmos' most powerful credit protocol. Featuring cross-collateralization and a single liquidation point.",
66
keywords:
77
'mars protocol, cosmos, credit protocol, crypto trading, margin trading, spot trading, cross-collateralization, defi, mars rovers, decentralized credit accounts, credit accounts',
8+
ogImage: 'https://app.marsprotocol.io/banner.jpg',
89
},
910
trade: {
1011
title: 'Mars Protocol - Trade',
1112
description:
1213
'Create a Rover credit account to begin spot and margin trading crypto assets with cross-collateralized positions and a single liquidation point.',
1314
keywords:
1415
'crypto trading, spot trading, margin trading, decentralized trading, defi, cross-collateralization, cosmos tokens',
16+
ogImage: 'https://app.marsprotocol.io/banner.jpg',
1517
},
1618
perps: {
1719
title: 'Mars Protocol - Perps',
1820
description: 'Trade perps on leverage with a single liquidation point.',
1921
keywords:
2022
'crypto trading, spot trading, margin trading, decentralized trading, defi, cross-collateralization, cosmos tokens',
23+
ogImage: 'https://app.marsprotocol.io/banner.jpg',
2124
},
2225
farm: {
2326
title: 'Mars Protocol - Farm',
2427
description:
2528
"Lend your crypto assets or deploy advanced defi strategies including leveraged yield farming and leveraged staking in Mars' Farm vaults.",
2629
keywords:
2730
'leveraged yield farming, crypto yield, leveraged staking, mars farm vaults, crypto lending, cosmos lending',
31+
ogImage: 'https://app.marsprotocol.io/banner.jpg',
2832
},
2933
lend: {
3034
title: 'Mars Protocol - Lend',
3135
description:
3236
"Lend your crypto assets or deploy advanced defi strategies including leveraged yield farming and leveraged staking in Mars' Farm vaults.",
3337
keywords:
3438
'leveraged yield farming, crypto yield, leveraged staking, mars farm vaults, crypto lending, cosmos lending',
39+
ogImage: 'https://app.marsprotocol.io/banner.jpg',
3540
},
3641
borrow: {
3742
title: 'Mars Protocol - Borrow',
3843
description:
3944
"Use your positions on Mars as collateral to borrow other assets. Then, put them to work in Mars' Farm Vaults or your trading strategies.",
4045
keywords:
4146
'borrow crypto, defi, cosmos credit protocol, cosmos lending, decentralized finance, crypto collateral, mars farm vaults, crypto lending',
47+
ogImage: 'https://app.marsprotocol.io/banner.jpg',
4248
},
4349
portfolio: {
4450
title: 'Mars Protocol - Portfolio',
4551
description:
4652
'Review all of your positions on Mars at a glance and make adjustments to keep your Rover credit accounts healthy and productive.',
4753
keywords:
4854
'rover credit accounts, mars credit accounts, mars, defi, crypto lending, crypto yield',
55+
ogImage: 'https://app.marsprotocol.io/banner.jpg',
4956
},
5057
council: {
5158
title: 'Mars Protocol - Council',
5259
description:
5360
'Stake MARS token to ascend to the Martian Council and help govern key changes to the protocol.',
5461
keywords: 'martian council, mars governance, cosmos governance, mars voting, mars staking',
62+
ogImage: 'https://app.marsprotocol.io/banner.jpg',
5563
},
5664
v1: {
5765
title: 'Mars Protocol',
5866
description: "Lend, borrow and earn on the galaxy's most powerful credit protocol.",
5967
keywords: 'martian council, mars governance, cosmos governance, mars voting, mars staking',
68+
ogImage: 'https://app.marsprotocol.io/banner.jpg',
6069
},
6170
}
6271

src/pages/_document.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,33 @@ export default function Document() {
44
return (
55
<Html className='p-0 m-0 scrollbar-hide' lang='en'>
66
<Head>
7+
{/* Primary Meta Tags */}
8+
<meta charSet='utf-8' />
9+
<meta name='robots' content='index,follow' />
10+
<meta name='theme-color' content='#ffffff' />
11+
<meta name='msapplication-TileColor' content='#ffffff' />
12+
13+
{/* Favicon and App Icons */}
14+
<link rel='icon' href='/favicon.svg' />
15+
<link rel='apple-touch-icon' sizes='180x180' href='/apple-touch-icon.png' />
16+
<link rel='manifest' href='/site.webmanifest' />
17+
<link rel='mask-icon' href='/safari-pinned-tab.svg' color='#dd5b65' />
18+
19+
{/* Open Graph / Facebook */}
20+
<meta property='og:type' content='website' />
21+
<meta property='og:url' content='https://app.marsprotocol.io' />
22+
<meta property='og:site_name' content='Mars Protocol' />
23+
<meta property='og:image' content='https://app.marsprotocol.io/banner.jpg' />
24+
<meta property='og:image:width' content='1200' />
25+
<meta property='og:image:height' content='630' />
26+
27+
{/* Twitter */}
28+
<meta name='twitter:card' content='summary_large_image' />
29+
<meta name='twitter:site' content='@mars_protocol' />
30+
<meta name='twitter:creator' content='@mars_protocol' />
31+
<meta name='twitter:image' content='https://app.marsprotocol.io/banner.jpg' />
32+
33+
{/* Scripts */}
734
<script defer src='/charting_library/charting_library.standalone.js' />
835
<script defer src='/datafeeds/udf/dist/bundle.js' />
936
<script defer src='https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.5.4/socket.io.js' />

0 commit comments

Comments
 (0)