Add meta descriptions for bisq

This commit is contained in:
hunicus
2023-08-28 13:10:08 +09:00
parent d1f26f0491
commit 6312884234
10 changed files with 27 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ import { StateService } from './state.service';
export class SeoService {
network = '';
baseTitle = 'mempool';
baseDescription = 'Explore the full Bitcoin ecosystem with The Mempool Open Project™.';
constructor(
private titleService: Title,
@@ -58,6 +59,12 @@ export class SeoService {
this.metaService.updateTag({ property: 'og:description', content: newDescription});
}
resetDescription(): void {
this.metaService.updateTag({ name: 'description', content: this.getDescription()});
this.metaService.updateTag({ name: 'twitter:description', content: this.getDescription()});
this.metaService.updateTag({ property: 'og:description', content: this.getDescription()});
}
getTitle(): string {
if (this.network === 'testnet')
return this.baseTitle + ' - Bitcoin Testnet';
@@ -72,6 +79,15 @@ export class SeoService {
return this.baseTitle + ' - ' + (this.network ? this.ucfirst(this.network) : 'Bitcoin') + ' Explorer';
}
getDescription(): string {
if ( (this.network === 'testnet') || (this.network === 'signet') || (this.network === '') || (this.network == 'mainnet') )
return this.baseDescription + ' See the real-time status of your transactions, browse network stats, and more.';
if ( (this.network === 'liquid') || (this.network === 'liquidtestnet') )
return this.baseDescription + ' See Liquid transactions & assets, get network info, and more.';
if (this.network === 'bisq')
return this.baseDescription + ' See Bisq market prices, trading activity, and more.';
}
ucfirst(str: string) {
return str.charAt(0).toUpperCase() + str.slice(1);
}