@reuters-graphics/graphics-components 0.0.19 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,15 +81,11 @@ const getOrigin = (baseUrl) => {
81
81
  };
82
82
  $: origin = getOrigin(baseUrl);
83
83
  $: canonicalUrl = origin + pageUrl.pathname;
84
- let hasEnabledPublisherTags = false;
85
84
  // Only fire analytics on prod sites
86
85
  $: {
87
86
  if (typeof window !== 'undefined' && includeAnalytics) {
88
87
  analytics(canonicalUrl, seoTitle);
89
- if (!hasEnabledPublisherTags) {
90
- publisherTags();
91
- hasEnabledPublisherTags = true;
92
- }
88
+ publisherTags();
93
89
  }
94
90
  }
95
91
  const orgLdJson = {
@@ -142,64 +138,66 @@ $: articleLdJson = {
142
138
  </script>
143
139
 
144
140
  <svelte:head>
145
- <title>{seoTitle}</title>
146
- <meta name="description" content="{seoDescription}" />
147
- <link rel="canonical" href="{canonicalUrl}" />
148
- <link
149
- rel="shortcut icon"
150
- type="image/x-icon"
151
- href="https://s3.reutersmedia.net/resources_v2/images/favicon/favicon.ico"
152
- />
153
- <link
154
- rel="icon"
155
- type="image/png"
156
- href="https://s3.reutersmedia.net/resources_v2/images/favicon/favicon-16x16.png"
157
- sizes="16x16"
158
- />
159
- <link
160
- rel="icon"
161
- type="image/png"
162
- href="https://s1.reutersmedia.net/resources_v2/images/favicon/favicon-32x32.png"
163
- sizes="32x32"
164
- />
165
- <link
166
- rel="icon"
167
- type="image/png"
168
- href="https://s3.reutersmedia.net/resources_v2/images/favicon/favicon-96x96.png"
169
- sizes="96x96"
170
- />
141
+ {#key canonicalUrl}
142
+ <title>{seoTitle}</title>
143
+ <meta name="description" content="{seoDescription}" />
144
+ <link rel="canonical" href="{canonicalUrl}" />
145
+ <link
146
+ rel="shortcut icon"
147
+ type="image/x-icon"
148
+ href="https://s3.reutersmedia.net/resources_v2/images/favicon/favicon.ico"
149
+ />
150
+ <link
151
+ rel="icon"
152
+ type="image/png"
153
+ href="https://s3.reutersmedia.net/resources_v2/images/favicon/favicon-16x16.png"
154
+ sizes="16x16"
155
+ />
156
+ <link
157
+ rel="icon"
158
+ type="image/png"
159
+ href="https://s1.reutersmedia.net/resources_v2/images/favicon/favicon-32x32.png"
160
+ sizes="32x32"
161
+ />
162
+ <link
163
+ rel="icon"
164
+ type="image/png"
165
+ href="https://s3.reutersmedia.net/resources_v2/images/favicon/favicon-96x96.png"
166
+ sizes="96x96"
167
+ />
171
168
 
172
- <meta property="og:url" content="{canonicalUrl}" />
173
- <meta property="og:type" content="article" />
174
- <meta property="og:title" content="{shareTitle}" itemprop="name" />
175
- <meta
176
- property="og:description"
177
- content="{shareDescription}"
178
- itemprop="description"
179
- />
180
- <meta property="og:image" content="{shareImgPath}" itemprop="image" />
181
- <meta property="og:site_name" content="Reuters" />
169
+ <meta property="og:url" content="{canonicalUrl}" />
170
+ <meta property="og:type" content="article" />
171
+ <meta property="og:title" content="{shareTitle}" itemprop="name" />
172
+ <meta
173
+ property="og:description"
174
+ content="{shareDescription}"
175
+ itemprop="description"
176
+ />
177
+ <meta property="og:image" content="{shareImgPath}" itemprop="image" />
178
+ <meta property="og:site_name" content="Reuters" />
182
179
 
183
- <meta name="twitter:card" content="summary_large_image" />
184
- <meta name="twitter:site" content="@ReutersGraphics" />
185
- <meta name="twitter:creator" content="@ReutersGraphics" />
186
- <meta name="twitter:domain" content="{origin}" />
187
- <meta name="twitter:title" content="{shareTitle}" />
188
- <meta name="twitter:description" content="{shareDescription}" />
189
- <meta name="twitter:image" content="{shareImgPath}" />
190
- {#if shareImgAlt}
191
- <meta name="twitter:image:alt" content="{shareImgAlt}" />
192
- {/if}
180
+ <meta name="twitter:card" content="summary_large_image" />
181
+ <meta name="twitter:site" content="@ReutersGraphics" />
182
+ <meta name="twitter:creator" content="@ReutersGraphics" />
183
+ <meta name="twitter:domain" content="{origin}" />
184
+ <meta name="twitter:title" content="{shareTitle}" />
185
+ <meta name="twitter:description" content="{shareDescription}" />
186
+ <meta name="twitter:image" content="{shareImgPath}" />
187
+ {#if shareImgAlt}
188
+ <meta name="twitter:image:alt" content="{shareImgAlt}" />
189
+ {/if}
193
190
 
194
- <meta property="fb:app_id" content="319194411438328" />
195
- <meta property="fb:admins" content="616167736" />
196
- <meta property="fb:admins" content="625796953" />
197
- <meta property="fb:admins" content="571759798" />
191
+ <meta property="fb:app_id" content="319194411438328" />
192
+ <meta property="fb:admins" content="616167736" />
193
+ <meta property="fb:admins" content="625796953" />
194
+ <meta property="fb:admins" content="571759798" />
198
195
 
199
- {@html `<${'script'} type="application/ld+json">${JSON.stringify(
200
- orgLdJson
201
- )}</script>`}
202
- {@html `<${'script'} type="application/ld+json">${JSON.stringify(
203
- articleLdJson
204
- )}</script>`}
196
+ {@html `<${'script'} type="application/ld+json">${JSON.stringify(
197
+ orgLdJson
198
+ )}</script>`}
199
+ {@html `<${'script'} type="application/ld+json">${JSON.stringify(
200
+ articleLdJson
201
+ )}</script>`}
202
+ {/key}
205
203
  </svelte:head>
@@ -1,7 +1,13 @@
1
1
  export default () => {
2
+ const { protocol } = document.location;
3
+ const gptScript = document.querySelector(
4
+ `script[src="${protocol}//www.googletagservices.com/tag/js/gpt.js"]`
5
+ );
6
+ // Only do this once.
7
+ if (gptScript) return;
2
8
  const googletag = window.googletag || {};
3
9
  googletag.cmd = googletag.cmd || [];
4
- (function() {
10
+ (function () {
5
11
  const gads = document.createElement('script');
6
12
  gads.async = true;
7
13
  gads.type = 'text/javascript';
@@ -12,7 +18,7 @@ export default () => {
12
18
  const node = document.getElementsByTagName('script')[0];
13
19
  node.parentNode.insertBefore(gads, node);
14
20
  })();
15
- googletag.cmd.push(function() {
21
+ googletag.cmd.push(function () {
16
22
  googletag
17
23
  .defineSlot(
18
24
  '/4735792/reuters_investigates',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reuters-graphics/graphics-components",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://reuters-graphics.github.io/graphics-components",