Skip to content

Commit

Permalink
Slightly improve the sharing interface + og image
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Dec 28, 2023
1 parent 19a009b commit 7b91ad5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
13 changes: 8 additions & 5 deletions projects/budgetkey/src/app/common-components/seo.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,20 @@ export class SeoService {
const link = head.querySelector('link[rel="canonical"]');
link?.setAttribute('href', canonical);

this.prepareShare(title.replace(this.globalSettings.siteName, '#מפתח_התקציב'), canonical);
let shareMessage = title
.replace(this.globalSettings.siteName + ' - ', '')
.replace(this.globalSettings.siteName, '');
this.prepareShare(shareMessage, canonical, 'מפתח_התקציב');
}

prepareShare(shareText: string, url: string) {
prepareShare(shareText: string, url: string, hashtag: string) {
this.shareData = {
text: shareText,
text: shareText + '\n#' + hashtag,
url
};
this.twitterShare = this.sanitizer.bypassSecurityTrustUrl(`http://twitter.com/share?text=${encodeURIComponent(shareText)}&url=${encodeURIComponent(url)}`);
this.twitterShare = this.sanitizer.bypassSecurityTrustUrl(`http://twitter.com/share?text=${encodeURIComponent(shareText)}&url=${encodeURIComponent(url)}&hashtags=${encodeURIComponent(hashtag)}`);
this.fbShare = this.sanitizer.bypassSecurityTrustUrl(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(url)}`);
this.whatsappShare = this.sanitizer.bypassSecurityTrustUrl(`https://wa.me/?text=${encodeURIComponent(shareText)} ${encodeURIComponent(url)}`);
this.whatsappShare = this.sanitizer.bypassSecurityTrustUrl(`https://wa.me/?text= ${encodeURIComponent(url)} ${encodeURIComponent(shareText)}`);
}

async mobileShare() {
Expand Down
Binary file added projects/budgetkey/src/assets/img/og.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions projects/budgetkey/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<base href="/"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<meta name="referrer" content="origin" />
<meta name="image" content="https://next.obudget.org/assets/common/img/obudget_key@2x.png"/>
<meta name="image" content="https://next.obudget.org/assets/img/og.png"/>
<meta name="canonical" content="https://next.obudget.org/"/>

<link rel="icon" type="image/x-icon" href="favicon.ico"/>
Expand All @@ -20,7 +20,7 @@
<meta property="og:title" content="מפתח התקציב"/>
<meta property="og:description" content="אספנו והנגשנו ב״מפתח התקציב״ את כל המידע על תקציב המדינה ועל הוצאות הממשלה – כדי שנוכל לדעת מה עושים עם הכסף שלנו…"/>
<meta property="og:url" content="https://next.obudget.org/"/>
<meta property="og:image" content="https://next.obudget.org/assets/common/img/obudget_key@2x.png"/>
<meta property="og:image" content="https://next.obudget.org/assets/img/og.png"/>
<meta property="og:site_name" content="מפתח התקציב"/>
<meta property="og:locale" content="he_IL"/>
<meta property="og:type" content="website"/>
Expand All @@ -32,10 +32,10 @@
<meta name="twitter:site" content="@hasadna"/>
<meta name="twitter:creator" content="@ikramvada"/>
<meta name="twitter:description" content="אספנו והנגשנו ב״מפתח התקציב״ את כל המידע על תקציב המדינה ועל הוצאות הממשלה – כדי שנוכל לדעת מה עושים עם הכסף שלנו…"/>
<meta name="twitter:image:src" content="https://next.obudget.org/assets/common/img/obudget_key@2x.png"/>
<meta name="twitter:image:src" content="https://next.obudget.org/assets/img/og.png"/>

<meta itemprop="name" content="מפתח התקציב"/>
<meta itemprop="image" content="https://next.obudget.org/assets/common/img/obudget_key@2x.png"/>
<meta itemprop="image" content="https://next.obudget.org/assets/img/og.png"/>

<link rel="canonical" href="https://next.obudget.org/"/>

Expand All @@ -57,7 +57,7 @@
"@type": "Organization",
"name": "מפתח התקציב - The Budget Key Project",
"url": "https://next.obudget.org/",
"logo": "https://next.obudget.org/assets/common/img/obudget_key@2x.png"
"logo": "https://next.obudget.org/assets/img/og.png"
}
</script>

Expand Down

0 comments on commit 7b91ad5

Please sign in to comment.