Skip to content

Commit 9e11751

Browse files
committed
Add meta tag for twitter site
commit 06b9c9d Author: Kristin Bradley <[email protected]> Date: Mon Jan 30 08:59:17 2023 -0800 HDS-1383 Use full url in img variable instead of concatenating commit 41a1975 Merge: 0b7d104 7dbf9e1 Author: Kristin Bradley <[email protected]> Date: Mon Jan 30 08:43:50 2023 -0800 Merge branch 'main' into hds-1383-twitter-preview commit 0b7d104 Merge: 0eb5686 3a57cdd Author: Kristin Bradley <[email protected]> Date: Fri Jan 27 11:00:48 2023 -0800 Merge branch 'main' into hds-1383-twitter-preview commit 0eb5686 Author: Kristin Bradley <[email protected]> Date: Wed Jan 25 16:47:32 2023 -0800 HDS-1383 Add public site url commit acfef3e Merge: ceb99d5 b3f5583 Author: Kristin Bradley <[email protected]> Date: Wed Jan 25 16:25:27 2023 -0800 Merge branch 'main' into hds-1383-twitter-preview # Conflicts: # website/config/environment.js commit ceb99d5 Merge: 87a26f8 636a9f1 Author: Kristin Bradley <[email protected]> Date: Thu Jan 12 13:41:21 2023 -0800 Merge branch 'main' into hds-1383-twitter-preview commit 87a26f8 Author: Kristin Bradley <[email protected]> Date: Thu Jan 12 13:32:37 2023 -0800 HDS-1383 Try renamining share image as a test commit 0a485ec Author: Kristin Bradley <[email protected]> Date: Thu Jan 12 12:01:29 2023 -0800 HDS-1383 Add hard-coded url to test commit 42f04ad Merge: b68c37f 53b0ea8 Author: Kristin Bradley <[email protected]> Date: Thu Jan 12 08:15:40 2023 -0800 Merge branch 'main' into hds-1383-twitter-preview commit b68c37f Author: Kristin Bradley <[email protected]> Date: Tue Jan 10 13:37:53 2023 -0800 HDS-1383 Fix meta tag for og url commit 17b0171 Merge: 8cdce1d f543893 Author: Kristin Bradley <[email protected]> Date: Tue Jan 10 13:18:47 2023 -0800 Merge branch 'main' into hds-1383-twitter-preview commit 8cdce1d Author: Kristin Bradley <[email protected]> Date: Tue Jan 10 09:39:03 2023 -0800 HDS-1383 Delete commented out meta tags commit 06848e0 Author: Kristin Bradley <[email protected]> Date: Mon Jan 9 16:12:57 2023 -0800 HDS-1383 Add test img url commit 455a8cb Author: Kristin Bradley <[email protected]> Date: Mon Jan 9 16:06:50 2023 -0800 HDS-1383 Test reordering and commnting out some meta tags commit 4cc0353 Author: Kristin Bradley <[email protected]> Date: Mon Jan 9 15:11:17 2023 -0800 HDS-1383 Fix broken imag url commit c830695 Author: Kristin Bradley <[email protected]> Date: Mon Jan 9 15:04:18 2023 -0800 HDS-1383 Fix linter bug commit 5be99a9 Author: Kristin Bradley <[email protected]> Date: Mon Jan 9 14:54:23 2023 -0800 HDS-1383 Test using ful url for image commit ecd9c1e Author: Kristin Bradley <[email protected]> Date: Mon Jan 9 13:46:42 2023 -0800 HDS-1383 Fix linter errors commit 0b6bf2f Author: Kristin Bradley <[email protected]> Date: Mon Jan 9 13:42:22 2023 -0800 HDS-1383 Make updates to meta tags from feedback commit c0d6a76 Author: Kristin Bradley <[email protected]> Date: Mon Jan 9 13:27:57 2023 -0800 HDS-1383 Change order of meta tags commit 59a2bea Author: Kristin Bradley <[email protected]> Date: Mon Jan 9 12:11:12 2023 -0800 HDS-1383 delete blank line commit da1ae52 Author: Kristin Bradley <[email protected]> Date: Mon Jan 9 12:09:41 2023 -0800 delete added tag commit 5dadcc9 Author: Kristin Bradley <[email protected]> Date: Mon Jan 9 12:02:24 2023 -0800 HDS-1383 Add meta tag for twitter site
1 parent 7dbf9e1 commit 9e11751

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

website/app/templates/head.hbs

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,50 +16,48 @@ We've made some small customizations to simplify this compared to the default te
1616

1717
{{#if this.model.url}}
1818
<link rel="canonical" href={{this.model.url}} />
19-
<meta property="og:url" content={{this.model.url}} />
2019
{{/if}}
2120

2221
{{! END GENERAL }}
2322

24-
{{! BEGIN OPENGRAPH }}
23+
{{! BEGIN TWITTER }}
24+
25+
<meta name="twitter:card" content="summary_large_image" />
2526

26-
{{#if this.model.siteName}}
27-
<meta property="og:site_name" content={{this.model.siteName}} />
27+
{{#if this.model.twitterUsername}}
28+
<meta name="twitter:site" content={{this.model.twitterUsername}} />
2829
{{/if}}
2930

3031
{{#if this.model.title}}
31-
<meta property="og:title" content={{this.model.title}} />
32+
<meta name="twitter:title" content={{this.model.title}} />
3233
{{/if}}
3334

3435
{{#if this.model.description}}
35-
<meta property="og:description" content={{this.model.description}} />
36+
<meta name="twitter:description" content={{this.model.description}} />
3637
{{/if}}
3738

3839
{{#if this.model.imgSrc}}
39-
<meta property="og:image" content={{this.model.imgSrc}} />
40-
<meta property="og:image:type" content="image/jpg" />
40+
<meta name="twitter:image" content={{this.model.imgSrc}} />
4141
{{/if}}
4242

43-
{{! END OPENGRAPH }}
43+
{{! END TWITTER }}
4444

45-
{{! BEGIN TWITTER }}
46-
47-
<meta name="twitter:card" content="summary" />
45+
{{! BEGIN OPENGRAPH }}
4846

49-
{{#if this.model.imgSrc}}
50-
<meta name="twitter:image" content={{this.model.imgSrc}} />
47+
{{#if this.model.url}}
48+
<meta property="og:url" content={{this.model.url}} />
5149
{{/if}}
5250

5351
{{#if this.model.title}}
54-
<meta name="twitter:title" content={{this.model.title}} />
52+
<meta property="og:title" content={{this.model.title}} />
5553
{{/if}}
5654

57-
{{#if this.model.url}}
58-
<meta name="twitter:url" content={{this.model.url}} />
55+
{{#if this.model.description}}
56+
<meta property="og:description" content={{this.model.description}} />
5957
{{/if}}
6058

61-
{{#if this.model.description}}
62-
<meta name="twitter:description" content={{this.model.description}} />
59+
{{#if this.model.imgSrc}}
60+
<meta property="og:image" content={{this.model.imgSrc}} />
6361
{{/if}}
6462

65-
{{! END TWITTER }}
63+
{{! END OPENGRAPH }}

website/config/environment.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ module.exports = function (environment) {
3333
'The Helios Design System from HashiCorp provides the open source building blocks to design and implement consistent, accessible, and delightful product experiences.',
3434
siteName: 'Helios Design System',
3535
title: 'Helios Design System',
36-
imgSrc: '/assets/logos/share-card.jpg',
37-
url: 'https://helios.hashicorp.design/',
36+
imgSrc: 'https://helios.hashicorp.design/assets/logos/share-card.jpg',
37+
twitterUsername: '@HashiCorp',
38+
url: 'https://helios.hashicorp.design',
3839
},
3940
};
4041

54.9 KB
Loading

0 commit comments

Comments
 (0)