Skip to content

Commit 645d655

Browse files
[DSC-1529] [CST-13917] add url tag, ad fallback for description
1 parent 8077041 commit 645d655

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/app/core/metadata/metadata.service.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ export class MetadataService {
170170
this.setOpenGraphTitleTag();
171171
this.setOpenGraphDescriptionTag();
172172
this.setOpenGraphImageTag();
173+
this.setOpenGraphUrlTag();
173174

174175
this.setTwitterTitleTag();
175176
this.setTwitterDescriptionTag();
@@ -421,7 +422,7 @@ export class MetadataService {
421422
*/
422423
private setOpenGraphDescriptionTag(): void {
423424
// TODO: truncate abstract
424-
const value = this.getMetaTagValue('dc.description.abstract');
425+
const value = this.getMetaTagValue('dc.description.abstract') ?? this.translate.instant('meta.tag.missing.description');
425426
this.addMetaTag('og:description', value);
426427
}
427428

@@ -432,6 +433,14 @@ export class MetadataService {
432433
this.setPrimaryBitstreamInBundleTag('og:image');
433434
}
434435

436+
/**
437+
* Add <meta name="og:url" ... > to the <head>
438+
*/
439+
private setOpenGraphUrlTag(): void {
440+
const value = this.getMetaTagValue('dc.identifier.uri');
441+
this.addMetaTag('og:url', value);
442+
}
443+
435444

436445
/**
437446
* Add <meta name="twitter:title" ... > to the <head>

src/assets/i18n/es.json5

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11728,6 +11728,9 @@
1172811728
// "access-control-option-end-date-note": "Select the date until which the related access condition is applied",
1172911729
"access-control-option-end-date-note": "Escoja la fecha hasta la cuál se aplicarán las condiciones de acceso especificadas",
1173011730

11731+
// "meta.tag.missing.description": "No description available"
11732+
// TODO New key - Add a translation
11733+
"meta.tag.missing.description": "No description available"
1173111734

1173211735

1173311736
}

0 commit comments

Comments
 (0)