Remove duplicate metadata tags
Some metadata was being set twice, because property and name attributes for Twitter items were both being set.
This commit is contained in:
parent
1b92c62353
commit
d1c12f9f6e
@ -53,7 +53,7 @@ export class OpenGraphService {
|
||||
const lang = this.LanguageService.getLanguage();
|
||||
const ogImageUrl = `${window.location.protocol}//${window.location.host}/render/${lang}/preview${this.router.url}`;
|
||||
this.metaService.updateTag({ property: 'og:image', content: ogImageUrl });
|
||||
this.metaService.updateTag({ property: 'twitter:image:src', content: ogImageUrl });
|
||||
this.metaService.updateTag({ name: 'twitter:image', content: ogImageUrl });
|
||||
this.metaService.updateTag({ property: 'og:image:type', content: 'image/png' });
|
||||
this.metaService.updateTag({ property: 'og:image:width', content: '1200' });
|
||||
this.metaService.updateTag({ property: 'og:image:height', content: '600' });
|
||||
@ -61,7 +61,7 @@ export class OpenGraphService {
|
||||
|
||||
clearOgImage() {
|
||||
this.metaService.updateTag({ property: 'og:image', content: this.defaultImageUrl });
|
||||
this.metaService.updateTag({ property: 'twitter:image:src', content: this.defaultImageUrl });
|
||||
this.metaService.updateTag({ name: 'twitter:image', content: this.defaultImageUrl });
|
||||
this.metaService.updateTag({ property: 'og:image:type', content: 'image/png' });
|
||||
this.metaService.updateTag({ property: 'og:image:width', content: '1000' });
|
||||
this.metaService.updateTag({ property: 'og:image:height', content: '500' });
|
||||
|
@ -39,14 +39,14 @@ export class SeoService {
|
||||
setTitle(newTitle: string): void {
|
||||
this.titleService.setTitle(newTitle + ' - ' + this.getTitle());
|
||||
this.metaService.updateTag({ property: 'og:title', content: newTitle});
|
||||
this.metaService.updateTag({ property: 'twitter:title', content: newTitle});
|
||||
this.metaService.updateTag({ name: 'twitter:title', content: newTitle});
|
||||
this.metaService.updateTag({ property: 'og:meta:ready', content: 'ready'});
|
||||
}
|
||||
|
||||
resetTitle(): void {
|
||||
this.titleService.setTitle(this.getTitle());
|
||||
this.metaService.updateTag({ property: 'og:title', content: this.getTitle()});
|
||||
this.metaService.updateTag({ property: 'twitter:title', content: this.getTitle()});
|
||||
this.metaService.updateTag({ name: 'twitter:title', content: this.getTitle()});
|
||||
this.metaService.updateTag({ property: 'og:meta:ready', content: 'ready'});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user