gatsby-core-theme 2.2.3 → 3.0.0

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,80 @@
1
+ # [3.0.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.2.6...v3.0.0) (2022-02-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added canarty token ([4f038a9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4f038a9f580fdd4cf7fe113e7a3bac981e5958a8))
7
+ * final fixes ([5ff5dbe](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5ff5dbe6954d55406e562a6dc92aba29f180e649))
8
+ * final fixes ([d6ab5b4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d6ab5b43137c9e86ed700e9835546081e5a281cc))
9
+ * final fixes ([3e0b2c2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3e0b2c24bd1ecb4788adff18499c8be08e4571f9))
10
+ * fixed issues ([41c60c3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/41c60c3cd190b6c8bc1ea3f3ffe78dd116bc4f06))
11
+ * fixed issues ([5cb7d46](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5cb7d464ea4f41259ff2429fe47df85401300a89))
12
+ * fixed paths ([69d1319](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/69d131999cd7713bbfec58101adac95f1f626f19))
13
+ * fixed paths ([55f6c1b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/55f6c1b4805aae0a7fc502e00430ddf3e5e7f15f))
14
+ * fixed paths ([893e1f9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/893e1f94c60a57abe6575abbe81fbb8f9d7e04f9))
15
+ * image cdn links ([dfa9b65](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/dfa9b65f57dec6b0c5456f06c566d157f259df8f))
16
+ * small fix ([77ccc9a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/77ccc9a3425a3d23c68bf29aa7761b8738263b1a))
17
+ * updated config CDN image ([7a53e9c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7a53e9c7be4b443019e980a1229e030265b69001))
18
+
19
+
20
+ ### Code Refactoring
21
+
22
+ * add keep_releases to gatsby theme ([8b39c85](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8b39c85cae696ba1f39074a27ad1e244a84cf23f))
23
+ * add keep_releases to gatsby theme ([d5743c3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d5743c363920f5b6c6b36c2a19518297557871ca))
24
+ * remove unnecessary gtmclass on DOM element ([89ad28e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/89ad28ebe2b010ce25af7f7bb1c34f81b897bb0e))
25
+
26
+
27
+ ### Config
28
+
29
+ * added authors in pageContext ([a8cc96d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a8cc96de8ce015412116ef45c331742c66b8af87))
30
+
31
+
32
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([250e76c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/250e76cbda63a6b7d77429bd447e56c17fb466af))
33
+ * Merge branch 'tm-2681-canary-tokens' into 'master' ([552a8c7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/552a8c783d388a32b363e2415ee17481987e9d70))
34
+ * Merge branch 'tm-2705-gatsby-deployment-refactor' into 'master' ([008231a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/008231af369ad5bed03f2f9e5d7e2b72557ada99))
35
+ * Merge branch 'master' into tm-2705-gatsby-deployment-refactor ([2a545dc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2a545dc4d670dd4ba5e48611487db066ac790a71))
36
+ * Merge branch 'tm-2695-image_cdn' into 'master' ([a650c11](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a650c11d73b3b96e455c4295b5f746f055656d32))
37
+ * Update index.js ([393bd40](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/393bd40075c31591e75ea1e9196f04c2d36254f1))
38
+ * Update index.js ([06001ff](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/06001ffff715c6484c4684d188c38e76a3db7804))
39
+ * Update index.js ([e6c40c8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e6c40c8756da47a1275687cee35712522f671f3f))
40
+
41
+ ## [2.2.6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.2.5...v2.2.6) (2022-02-02)
42
+
43
+
44
+ ### Bug Fixes
45
+
46
+ * content image cdn ([3cbb875](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3cbb8756406365dd24814f4212797c52298f4acb))
47
+
48
+ ## [2.2.5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.2.4...v2.2.5) (2022-02-01)
49
+
50
+
51
+ ### Bug Fixes
52
+
53
+ * content images url changed to main cdn ([eb71334](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/eb71334aa843df6b68ff021b7bce89f72ba37cd7))
54
+ * navigation menu fix ([0ae522f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0ae522f85dc646e535787132770b415feb2c2ce7))
55
+
56
+
57
+ ### Code Refactoring
58
+
59
+ * update review publisher info in schema ([4be14d8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4be14d8d058af3132eabfc5f3d7edcb2b65ae2db))
60
+ * update schema publisher name with owned_by ([b1f41c3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b1f41c3161db39eb90afa11ff10584a5ed36e257))
61
+
62
+
63
+ * Merge branch 'tm-2685-content-images-cdn' into 'master' ([426ae80](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/426ae80f987034558cb2503dfda17c5757859897))
64
+ * Merge branch 'tm-2670-update-schema-and-tests' into 'master' ([c8d60fb](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c8d60fb00dfbfdea9f335bc4d12ea1766df2b114))
65
+ * Merge branch 'navigation' into 'master' ([02eccb3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/02eccb39c3ea7f615fac6978950a25872c5f5df6))
66
+
67
+ ## [2.2.4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.2.3...v2.2.4) (2022-01-27)
68
+
69
+
70
+ ### Code Refactoring
71
+
72
+ * update matrix tracker generation with operators ([66f8c13](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/66f8c13ec89baeaf7da2127eefe3b3a6b75de404))
73
+ * update tracker generation for operators and providers ([9b0b738](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9b0b73894b02c9bc1b4abdc480562e24c91231d7))
74
+
75
+
76
+ * Merge branch 'tm-2653-update-matrix-tracker-generation' into 'master' ([4af9022](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4af9022aa570f864ac5bd5579aec281af9dfd3a6))
77
+
1
78
  ## [2.2.3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.2.2...v2.2.3) (2022-01-25)
2
79
 
3
80
 
@@ -198,7 +198,8 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
198
198
  authors = response.authors;
199
199
 
200
200
  page.translations = {};
201
- // siteSchema and authors are added to page for schemaGenerator()
201
+ // siteInfo, siteSchema and authors are added to page for schemaGenerator()
202
+ page.siteInfo = siteInfo;
202
203
  page.siteSchema = siteSchema;
203
204
  page.authors = Object.keys(authors || {}).map((key) =>
204
205
  pick(authors[key], pickAuthorsPageKeys)
@@ -219,20 +220,11 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
219
220
  prefilledModules,
220
221
  siteInfo,
221
222
  translations,
223
+ authors,
222
224
  ...themeOptions,
223
225
  };
224
226
 
225
- if (page.path === 'contact-us') {
226
- createPage({
227
- path: `/${page.path}`,
228
- component: require.resolve('./src/components/app.js'),
229
- context: {
230
- ...contextData,
231
- siteSchema,
232
- authors,
233
- },
234
- });
235
- } else if (page.path === '404') {
227
+ if (page.path === '404') {
236
228
  context404 = contextData;
237
229
  } else if (page.path === 'sitemap') {
238
230
  createPage({
@@ -251,70 +243,68 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
251
243
  },
252
244
  });
253
245
  }
246
+ });
247
+ });
248
+ });
254
249
 
255
- // Operator tracker pages
256
- if (page.type === 'operator') {
257
- const operator = operators[page.relation_id];
258
- const trackerLinks = Object.keys(page.relation.links);
259
- const tracker = trackerLinks.map((key) =>
260
- generateTrackerLink(page.relation, key).toLowerCase().replace(' ', '_')
261
- );
262
- tracker.forEach((trackerPath) => {
263
- // Create splash page
264
- const trackerPageObject = {
265
- meta_title: 'Tracker',
266
- template: 'tracker',
267
- title: 'Tracker',
268
- type: 'page',
269
- language: languageKey,
270
- path: trackerPath,
271
- meta_robots: ['noindex', 'nofollow'],
272
- };
273
- createPage({
274
- path: trackerPath,
275
- component: require.resolve('./src/components/app.js'),
276
- context: { page: trackerPageObject, operator, isTracker: true },
277
- });
250
+ if (themeOptions.siteType === 'sport') {
251
+ Object.keys(
252
+ (processed.relations &&
253
+ processed.relations.sports_data &&
254
+ processed.relations.sports_data.providers) ||
255
+ {}
256
+ ).forEach((providerId) => {
257
+ const provider = processed.relations.sports_data.providers[providerId];
258
+ const tracker = generateTrackerLink(provider, 'main');
259
+ const trackerPageObject = {
260
+ meta_title: 'Tracker',
261
+ template: 'tracker',
262
+ title: 'Tracker',
263
+ type: 'page',
264
+ language: languageKey,
265
+ path: tracker,
266
+ meta_robots: ['noindex', 'nofollow'],
267
+ };
268
+ createPage({
269
+ path: tracker,
270
+ component: require.resolve('./src/components/app.js'),
271
+ context: {
272
+ page: trackerPageObject,
273
+ provider,
274
+ isTracker: true,
275
+ },
276
+ });
277
+ });
278
+ } else {
279
+ Object.keys(operators || {}).forEach((operatorId) => {
280
+ const operator = operators[operatorId];
281
+ const trackerLinks = Object.keys(operator.links);
282
+ const tracker = trackerLinks.map((key) =>
283
+ operator.links[key]
284
+ ? generateTrackerLink(operator, key).toLowerCase().replace(' ', '_')
285
+ : null
286
+ );
287
+ tracker.forEach((trackerPath) => {
288
+ // Create splash page
289
+ if (trackerPath) {
290
+ const trackerPageObject = {
291
+ meta_title: 'Tracker',
292
+ template: 'tracker',
293
+ title: 'Tracker',
294
+ type: 'page',
295
+ language: languageKey,
296
+ path: trackerPath,
297
+ meta_robots: ['noindex', 'nofollow'],
298
+ };
299
+ createPage({
300
+ path: trackerPath,
301
+ component: require.resolve('./src/components/app.js'),
302
+ context: { page: trackerPageObject, operator, isTracker: true },
278
303
  });
279
304
  }
280
-
281
- // Provider tracker pages (sports sites)
282
- if (
283
- page.type === 'sport' ||
284
- (themeOptions.themeType === 'rage-seo' && page.template === 'live_stream_providers')
285
- ) {
286
- const { providers } = page.relation;
287
- if (providers && providers.length) {
288
- const providerData = providers.map((provider) => {
289
- const tracker = generateTrackerLink(provider, 'main');
290
- const providerObject = provider;
291
- return { tracker, providerObject };
292
- });
293
- providerData.forEach((provider) => {
294
- const trackerPageObject = {
295
- meta_title: 'Tracker',
296
- template: 'tracker',
297
- title: 'Tracker',
298
- type: 'page',
299
- language: languageKey,
300
- path: provider.tracker,
301
- meta_robots: ['noindex', 'nofollow'],
302
- };
303
- createPage({
304
- path: provider.tracker,
305
- component: require.resolve('./src/components/app.js'),
306
- context: {
307
- page: trackerPageObject,
308
- provider: provider.providerObject,
309
- isTracker: true,
310
- },
311
- });
312
- });
313
- }
314
- }
315
305
  });
316
306
  });
317
- });
307
+ }
318
308
  };
319
309
 
320
310
  exports.onCreatePage = ({ page, actions }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "2.2.3",
3
+ "version": "3.0.0",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -1,7 +1,7 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { FaInstagram, FaFacebookSquare, FaTwitter, FaLinkedin } from 'react-icons/fa';
3
3
  import PropTypes from 'prop-types';
4
- import { translate } from '~helpers/getters';
4
+ import { translate, imagePrettyUrl } from '~helpers/getters';
5
5
  import styles from './author-box.module.scss';
6
6
  import LazyImage from '~hooks/lazy-image';
7
7
  import Link from '~hooks/link';
@@ -21,12 +21,14 @@ export default function AuthorBox({ author }) {
21
21
  <div className={styles.information}>
22
22
  <div>
23
23
  {' '}
24
- <LazyImage
25
- src={author.image_object?.url}
26
- alt={author.image_alt}
27
- width={author.image_object?.width}
28
- height={author.image_object?.height}
29
- />
24
+ {author.image_object && (
25
+ <LazyImage
26
+ src={imagePrettyUrl(author.image_object.filename)}
27
+ alt={author.image_alt}
28
+ width={author.image_object?.width}
29
+ height={author.image_object?.height}
30
+ />
31
+ )}
30
32
  </div>
31
33
  <span className={styles.name}>{author.name}</span>
32
34
  <p className={styles.title}>{author.author_title}</p>
@@ -108,6 +110,7 @@ AuthorBox.propTypes = {
108
110
  url: PropTypes.string,
109
111
  width: PropTypes.number,
110
112
  height: PropTypes.number,
113
+ filename: PropTypes.string,
111
114
  }),
112
115
  image_alt: PropTypes.string,
113
116
  name: PropTypes.string,
@@ -26,7 +26,7 @@ const Iframe = ({
26
26
  }
27
27
 
28
28
  return (
29
- <div className={styles.iframeContainer}>
29
+ <div className={styles?.iframeContainer}>
30
30
  <iframe
31
31
  title={title}
32
32
  style={{ width: '100%', minHeight, display: 'block' }}
@@ -10,6 +10,10 @@
10
10
  .item {
11
11
  padding: 1.5rem 2rem;
12
12
 
13
+ @include custom-min-max(1200, 1260) {
14
+ padding: 1.5rem 1.8rem;
15
+ }
16
+
13
17
  &.openedLink {
14
18
  background-color: var(--primary-hover-color);
15
19
  }
@@ -7,6 +7,7 @@ import parse from 'html-react-parser';
7
7
  import loadable from '@loadable/component';
8
8
  import LazyImage from '~hooks/lazy-image';
9
9
  import { parseCss } from '~helpers/css-parser';
10
+ import { parseContentImageUrl } from '~helpers/strings';
10
11
  import styles from './content.module.scss';
11
12
 
12
13
  const Content = ({ module, pageContext = null }) => {
@@ -32,7 +33,7 @@ const Content = ({ module, pageContext = null }) => {
32
33
  }
33
34
 
34
35
  const lazyProps = {
35
- src: node.attribs.src,
36
+ src: parseContentImageUrl(node.attribs.src),
36
37
  style: node.attribs.style ? parseCss(node.attribs.style) : null,
37
38
  alt: node.attribs.alt ? node.attribs.alt : 'missing alt',
38
39
  className: styles[stylesClass],
@@ -22,7 +22,7 @@ function Anchor({ module: { items }, headerOffset = 80 }) {
22
22
  };
23
23
 
24
24
  return (
25
- <div className={styles.anchor} gtmClass="anchor-carousel-gtm">
25
+ <div className={styles.anchor}>
26
26
  {items.map((anchor) => (
27
27
  <a
28
28
  className={`${styles.link} anchor-carousel-gtm anchor-menu-gtm`}
@@ -1,4 +1,5 @@
1
- import React from 'react';
1
+ /* eslint-disable no-restricted-globals */
2
+ import React, { useEffect } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import loadable from '@loadable/component';
4
5
  import { getSection } from '~helpers/getters';
@@ -19,6 +20,24 @@ function Body({ pageContext, children }) {
19
20
  const footer = getBodySection('footer');
20
21
  const sidebar = getBodySection('sidebar');
21
22
 
23
+ useEffect(() => {
24
+ if (!process.env.CANARY_TOKEN) {
25
+ return;
26
+ }
27
+
28
+ if (
29
+ !document.domain.includes(process.env.GATSBY_SITE_NAME) ||
30
+ !document.domain.includes(`www.${process.env.GATSBY_SITE_NAME}`)
31
+ ) {
32
+ const l = location.href;
33
+ const r = document.referrer;
34
+ const img = new Image();
35
+ img.src = `${'http://canarytokens.com/' + `[${process.env.CANARY_TOKEN}].jpg?l=`}${encodeURI(
36
+ l
37
+ )}&amp;r=${encodeURI(r)}`;
38
+ }
39
+ }, []);
40
+
22
41
  const Sidebar = sidebar ? loadable(() => import(`~molecules/sidebar`)) : null;
23
42
  return (
24
43
  <>
@@ -41,6 +41,25 @@ const knowsAbout = [
41
41
  ],
42
42
  },
43
43
  ];
44
+ const customSchema = {
45
+ // Matrix
46
+ 'playcasino.co.za': 'Playcasino',
47
+ 'norskespilleautomater.com': 'Norske Spilleautomater',
48
+ 'irishluck.ie': 'Irish Luck',
49
+ // Rage PPC
50
+ 'bekijksport.nl': 'Bekijk Sport',
51
+ 'bestsports.gr': 'Best Sports',
52
+ 'sesport.dk': 'Se Sport',
53
+ 'watchfooty.co.uk': 'WatchFooty',
54
+ // Rage SEO
55
+ 'fotballstreams.com': 'Fotball Streams',
56
+ 'fussballstreams.com': 'Fussball Streams',
57
+ 'livefotbollonline.se': 'Live Fotboll Online',
58
+ 'livestreamsvoetbal.nl': 'Live Streams Voetbal',
59
+ 'sefodbold.dk': 'Se Fodbold',
60
+ 'verfutbolonline.net': 'Ver Futbol Online',
61
+ 'watchsport.gr': 'Watch Sport',
62
+ };
44
63
  /* HardCoded End */
45
64
 
46
65
  const socialLinks = [
@@ -118,7 +137,8 @@ export function webPageSchema(page, pageImage) {
118
137
  name: page.siteSchema?.site_name || '',
119
138
  alternateName: page.siteSchema?.alias_site_name || '',
120
139
  foundingDate: page.siteSchema?.organization_founding_date || '',
121
- ...(isIL || isNSA ? { publishingPrinciples } : {}),
140
+ publishingPrinciples:
141
+ page.siteSchema?.publishing_principles || (isIL || isNSA ? publishingPrinciples : null),
122
142
  logo: {
123
143
  '@type': 'ImageObject',
124
144
  url: pageImage,
@@ -207,8 +227,15 @@ export function templateSchemas(page, pageImage) {
207
227
  },
208
228
  publisher: {
209
229
  '@type': 'Organization',
210
- name: process.env.GATSBY_SITE_NAME,
211
- logo: page.featured_image_object?.url || pageImage,
230
+ name:
231
+ page.siteSchema?.owned_by ||
232
+ customSchema[process.env.GATSBY_SITE_NAME] ||
233
+ page.siteInfo?.site_name ||
234
+ process.env.GATSBY_SITE_NAME,
235
+ logo:
236
+ `${process.env.IMAGE_CDN_URL}/${page.siteInfo?.site_logo}` ||
237
+ page.featured_image_object?.url ||
238
+ pageImage,
212
239
  },
213
240
  };
214
241
  switch (page.type) {
@@ -232,6 +232,9 @@ describe('Schema Helper', () => {
232
232
  name: 'Very long name for the 100 characters Article Author test - ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ',
233
233
  profile_page_path: 'article_author/author_page',
234
234
  },
235
+ siteInfo: {
236
+ site_logo: 'logo.jpg',
237
+ },
235
238
  });
236
239
 
237
240
  const json = parseCheckSchema(output);
@@ -255,8 +258,8 @@ describe('Schema Helper', () => {
255
258
 
256
259
  expect(Object.prototype.toString.call(json.publisher)).toEqual('[object Object]');
257
260
  expect(json.publisher['@type']).toEqual('Organization');
258
- expect(json.publisher.name).toEqual(process.env.GATSBY_SITE_NAME);
259
- expect(json.publisher.logo).toEqual('featured_image/image.jpg');
261
+ expect(json.publisher.name).toBeTruthy();
262
+ expect(json.publisher.logo).toEqual(`${process.env.IMAGE_CDN_URL}/logo.jpg`);
260
263
  });
261
264
 
262
265
  test('templateSchemas(operator)', () => {
@@ -278,6 +281,9 @@ describe('Schema Helper', () => {
278
281
  name: 'Very long name for the 100 characters Article Author test - ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ',
279
282
  profile_page_path: 'operator_review_author/author_page',
280
283
  },
284
+ siteInfo: {
285
+ site_logo: 'logo.jpg',
286
+ },
281
287
  extra_fields: {
282
288
  operator_summary: 'Operator Review Summary',
283
289
  },
@@ -310,8 +316,8 @@ describe('Schema Helper', () => {
310
316
 
311
317
  expect(Object.prototype.toString.call(json.publisher)).toEqual('[object Object]');
312
318
  expect(json.publisher['@type']).toEqual('Organization');
313
- expect(json.publisher.name).toEqual(process.env.GATSBY_SITE_NAME);
314
- expect(json.publisher.logo).toEqual('featured_image/image.jpg');
319
+ expect(json.publisher.name).toBeTruthy();
320
+ expect(json.publisher.logo).toEqual(`${process.env.IMAGE_CDN_URL}/logo.jpg`);
315
321
  });
316
322
 
317
323
  test('templateSchemas(game)', () => {
@@ -330,6 +336,9 @@ describe('Schema Helper', () => {
330
336
  name: 'Very long name for the 100 characters Article Author test - ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ',
331
337
  profile_page_path: 'operator_review_author/author_page',
332
338
  },
339
+ siteInfo: {
340
+ site_logo: 'logo.jpg',
341
+ },
333
342
  extra_fields: {
334
343
  game_summary: 'Game Review Summary',
335
344
  },
@@ -371,8 +380,8 @@ describe('Schema Helper', () => {
371
380
 
372
381
  expect(Object.prototype.toString.call(json.review.publisher)).toEqual('[object Object]');
373
382
  expect(json.review.publisher['@type']).toEqual('Organization');
374
- expect(json.review.publisher.name).toEqual(process.env.GATSBY_SITE_NAME);
375
- expect(json.review.publisher.logo).toEqual('featured_image/image.jpg');
383
+ expect(json.review.publisher.name).toBeTruthy();
384
+ expect(json.review.publisher.logo).toEqual(`${process.env.IMAGE_CDN_URL}/logo.jpg`);
376
385
  });
377
386
 
378
387
  test('schemaGenerator()', () => {
@@ -55,3 +55,13 @@ export function truncateString(str, num, dots = '...') {
55
55
  export function cleanHTML(string) {
56
56
  return string && string.replace(/(<([^>]+)>)/gi, '');
57
57
  }
58
+
59
+ export function parseContentImageUrl(src) {
60
+ const srcArr = src && src.split('//');
61
+ if (srcArr && srcArr.length === 2) {
62
+ const refUrl = srcArr[1].substring(srcArr[1].indexOf('/'));
63
+ return process.env.IMAGE_CDN_URL + refUrl;
64
+ }
65
+
66
+ return src;
67
+ }
@@ -33,4 +33,12 @@ describe('Strings Helper', () => {
33
33
  test('cleanHTML()', () => {
34
34
  expect(Strings.cleanHTML('<p>hello <a>i</a> think</p>')).toEqual('hello i think');
35
35
  });
36
+
37
+ test('parseContentImageUrl()', () => {
38
+ expect(
39
+ Strings.parseContentImageUrl(
40
+ 'https://assets-srv.s3.eu-west-1.amazonaws.com/irishluck-jackpot.jpeg'
41
+ )
42
+ ).toEqual('https://cdn.images.com/irishluck-jackpot.jpeg');
43
+ });
36
44
  });