Update canonical link with block hash

This commit is contained in:
Mononaut
2023-08-22 02:54:23 +09:00
committed by softsimon
parent b6f66a6a28
commit 368ab1dc66
3 changed files with 14 additions and 0 deletions

View File

@@ -12,6 +12,8 @@ export class SeoService {
baseTitle = 'mempool';
baseDescription = 'Explore the full Bitcoin ecosystem with The Mempool Open Project™.';
canonicalLink: HTMLElement = document.getElementById('canonical');
constructor(
private titleService: Title,
private metaService: Meta,
@@ -65,6 +67,16 @@ export class SeoService {
this.metaService.updateTag({ property: 'og:description', content: this.getDescription()});
}
updateCanonical(path) {
let domain = 'mempool.space';
if (this.stateService.env.BASE_MODULE === 'liquid') {
domain = 'liquid.network';
} else if (this.stateService.env.BASE_MODULE === 'bisq') {
domain = 'bisq.markets';
}
this.canonicalLink.setAttribute('href', 'https://' + domain + path);
}
getTitle(): string {
if (this.network === 'testnet')
return this.baseTitle + ' - Bitcoin Testnet';