Skip to content

Commit

Permalink
Meta property (#571)
Browse files Browse the repository at this point in the history
* Social Share Preview

* LimiteDescription

* wip

* ATTR.CONTENT

* Optimisation de code
  • Loading branch information
kachourihassen authored Sep 28, 2023
1 parent a30b195 commit b88495b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@

<!--

<head>
<meta property="og:title" content="{{ 'campaign?.title'}}" />
<meta property="og:description" content="{{ 'campaign?.summary' }}" />
<meta property="og:image" content="{{ 'ogImageUrl' }}" />
<!-- <meta property="og:title" content="{{ 'campaign?.title'}}" /> -->
<!-- <meta property="og:description" content="{{ 'campaign?.summary' }}" /> -->
<!-- <meta property="og:image" content="{{ 'ogImageUrl' }}" /> -->
<meta property="og:title" [attr.content]="campaign?.title" />
<meta property="og:description" [attr.content]="limitDescription(campaign?.summary)" />
<meta property="og:image" [attr.content]="ogImageUrl" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
</head>

-->


<ng-container *ngIf="campaign?.id === campaignId; else loading">
<div class="content" style="min-height: 50vh">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ export class CampaignDetailsContainerComponent implements OnInit {
imageImported(image: any) {
this.campaignsStoreService.updateOneById({ cover: image });
}

limitDescription(description: string | undefined, maxLength: number = 200): string {
return description ? description.slice(0, maxLength) : '';
}
ngOnDestroy(): void {
this.isDestroyed.next('');
this.isDestroyed.unsubscribe();
Expand Down

0 comments on commit b88495b

Please sign in to comment.