mirror of
https://github.com/mempool/mempool.git
synced 2025-03-13 19:37:47 +01:00
Merge pull request #5690 from mempool/mononaut/fix-unfurler-meta-title
fix unfurler meta titles
This commit is contained in:
commit
4daa997e58
2 changed files with 7 additions and 2 deletions
|
@ -30,6 +30,7 @@ class Server {
|
|||
secureHost = true;
|
||||
secureMempoolHost = true;
|
||||
canonicalHost: string;
|
||||
networkName: string;
|
||||
|
||||
seoQueueLength: number = 0;
|
||||
unfurlQueueLength: number = 0;
|
||||
|
@ -41,6 +42,7 @@ class Server {
|
|||
this.secureHost = config.SERVER.HOST.startsWith('https');
|
||||
this.secureMempoolHost = config.MEMPOOL.HTTP_HOST.startsWith('https');
|
||||
this.network = config.MEMPOOL.NETWORK || 'bitcoin';
|
||||
this.networkName = networks[this.network].networkName || capitalize(this.network);
|
||||
|
||||
let canonical;
|
||||
switch(config.MEMPOOL.NETWORK) {
|
||||
|
@ -339,7 +341,7 @@ class Server {
|
|||
|
||||
if (matchedRoute.render) {
|
||||
ogImageUrl = `${config.SERVER.HOST}/render/${lang || 'en'}/preview${path}`;
|
||||
ogTitle = `${this.network ? capitalize(this.network) + ' ' : ''}${matchedRoute.networkMode !== 'mainnet' ? capitalize(matchedRoute.networkMode) + ' ' : ''}${matchedRoute.title}`;
|
||||
ogTitle = `${this.networkName} ${matchedRoute.networkMode !== 'mainnet' ? capitalize(matchedRoute.networkMode) + ' ' : ''}${matchedRoute.title}`;
|
||||
} else {
|
||||
ogTitle = networks[this.network].title;
|
||||
}
|
||||
|
@ -394,7 +396,7 @@ class Server {
|
|||
|
||||
if (matchedRoute.render) {
|
||||
ogImageUrl = `${config.SERVER.HOST}/render/${lang || 'en'}/preview${path}`;
|
||||
ogTitle = `${this.network ? capitalize(this.network) + ' ' : ''}${matchedRoute.networkMode !== 'mainnet' ? capitalize(matchedRoute.networkMode) + ' ' : ''}${matchedRoute.title}`;
|
||||
ogTitle = `${this.networkName} ${matchedRoute.networkMode !== 'mainnet' ? capitalize(matchedRoute.networkMode) + ' ' : ''}${matchedRoute.title}`;
|
||||
}
|
||||
|
||||
if (matchedRoute.sip) {
|
||||
|
|
|
@ -270,6 +270,7 @@ export const networks = {
|
|||
routes: {} // no routes supported
|
||||
},
|
||||
onbtc: {
|
||||
networkName: 'ONBTC',
|
||||
title: 'National Bitcoin Office of El Salvador',
|
||||
description: 'The National Bitcoin Office (ONBTC) of El Salvador under President @nayibbukele',
|
||||
fallbackImg: '/resources/onbtc/onbtc-preview.jpg',
|
||||
|
@ -290,6 +291,7 @@ export const networks = {
|
|||
}
|
||||
},
|
||||
bitb: {
|
||||
networkName: 'BITB',
|
||||
title: 'BITB | Bitwise Bitcoin ETF',
|
||||
description: 'BITB provides low-cost access to bitcoin through a professionally managed fund',
|
||||
fallbackImg: '/resources/bitb/bitb-preview.jpg',
|
||||
|
@ -311,6 +313,7 @@ export const networks = {
|
|||
}
|
||||
},
|
||||
meta: {
|
||||
networkName: 'Metaplanet',
|
||||
title: 'Metaplanet Inc.',
|
||||
description: 'Secure the Future with Bitcoin',
|
||||
fallbackImg: '/resources/meta/meta-preview.png',
|
||||
|
|
Loading…
Add table
Reference in a new issue