fix unfurler meta titles

This commit is contained in:
Mononaut 2024-12-13 22:09:14 +00:00
parent 90bb5304ef
commit 8b73bdfba9
No known key found for this signature in database
GPG key ID: A3F058E41374C04E
2 changed files with 7 additions and 2 deletions

View file

@ -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) {

View file

@ -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',