Skip to content

Commit

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

* LimiteDescription

* wip

* ATTR.CONTENT

* Optimisation de code

* change by content

* inside the index

* wip

* remove all meta bin side the campaign details

* updateMetaTags

* delete the meta in the index html

* delete the meta in the index html

* delete the meta in the index html

* delete the meta in the index
  • Loading branch information
kachourihassen authored Sep 29, 2023
1 parent 1dd65ec commit 4c8fbba
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

<!-- <head>
<meta property="og:title" content="{{ 'campaign?.title' }}" />
<meta property="og:description" content="{{ 'campaign?.summary' }}" />
Expand All @@ -9,11 +9,7 @@
<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 @@ -152,7 +152,7 @@ export class CampaignDetailsContainerComponent implements OnInit {
setTimeout(() => {
this.showmoonboy = campaign.id === this.campaignId;
}, 1000);

/*this.ogImageUrl = campaign.coverSrcMobile.includes('ipfs') ? ipfsURL + campaign.coverSrcMobile.substring(27, campaign.coverSrcMobile.length) : campaign.coverSrcMobile;
this.meta.updateTag({ property: 'og:title', content: campaign.title });
this.meta.updateTag({ property: 'og:description', content: campaign.description });
Expand Down Expand Up @@ -292,13 +292,31 @@ export class CampaignDetailsContainerComponent implements OnInit {
this.updateMetaTags(campaign);
});
}
updateMetaTags(campaign: Campaign) {
if (campaign) {
this.ogImageUrl = campaign.coverSrcMobile.includes('ipfs')
? ipfsURL + campaign.coverSrcMobile.substring(27, campaign.coverSrcMobile.length)
: campaign.coverSrcMobile;

this.meta.updateTag({ property: 'og:title', content: campaign.title });
this.meta.updateTag({ property: 'og:description', content: campaign.description });
this.meta.updateTag({ property: 'og:image', content: this.ogImageUrl });

this.meta.updateTag({ property: 'og:image:width', content: '1200' });
this.meta.updateTag({ property: 'og:image:height', content: '630' });

this.meta.updateTag({ name: 'twitter:card', content: 'summary_large_image' });
this.meta.updateTag({ name: 'twitter:image', content: this.ogImageUrl });
}
}

imageImported(image: any) {
this.campaignsStoreService.updateOneById({ cover: image });
}
limitDescription(description: string | undefined, maxLength: number = 200): string {
return description ? description.slice(0, maxLength) : '';
}


updateMetaTags(campaign: Campaign) {
if (campaign) {
Expand All @@ -310,6 +328,7 @@ export class CampaignDetailsContainerComponent implements OnInit {
this.meta.updateTag({ property: 'og:description', content: campaign.description });
this.meta.updateTag({ property: 'og:image', content: this.ogImageUrl });


this.meta.updateTag({ property: 'og:image:width', content: '1200' });
this.meta.updateTag({ property: 'og:image:height', content: '630' });

Expand Down
17 changes: 8 additions & 9 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="#1f2337" />
<meta name="twitter:card" content="summary">

<title>SaTT - Smart advertising Transaction Token</title>

<!-- <meta name="twitter:card" content="summary"> -->

<!-- <title>SaTT - Smart advertising Transaction Token</title> -->


<base href="/" />
<meta
Expand All @@ -46,12 +45,12 @@
<meta property="og:title" content="SaTT - Smart advertising Transaction Token" />
-->


<meta name="keyword" content="crypto, blockchain, social media, farming, earning crypto, profitable, marketing, influencers, brand, SaTT, token, Trust, wallet">

</meta>


<meta
name="keyword"
content="crypto, blockchain, social media, farming, earning crypto, profitable, marketing, influencers, brand, SaTT, token, Trust, wallet"
/>

<!--<meta
name="facebook-domain-verification"
content="ag3bpno6r3diau1vlmnxrmf0i6g4vd"
Expand Down

0 comments on commit 4c8fbba

Please sign in to comment.