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