gatsby-core-theme 2.2.6 → 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,43 @@
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
+
1
41
  ## [2.2.6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.2.5...v2.2.6) (2022-02-02)
2
42
 
3
43
 
@@ -220,20 +220,11 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
220
220
  prefilledModules,
221
221
  siteInfo,
222
222
  translations,
223
+ authors,
223
224
  ...themeOptions,
224
225
  };
225
226
 
226
- if (page.path === 'contact-us') {
227
- createPage({
228
- path: `/${page.path}`,
229
- component: require.resolve('./src/components/app.js'),
230
- context: {
231
- ...contextData,
232
- siteSchema,
233
- authors,
234
- },
235
- });
236
- } else if (page.path === '404') {
227
+ if (page.path === '404') {
237
228
  context404 = contextData;
238
229
  } else if (page.path === 'sitemap') {
239
230
  createPage({
@@ -260,8 +251,8 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
260
251
  Object.keys(
261
252
  (processed.relations &&
262
253
  processed.relations.sports_data &&
263
- processed.relations.sports_data.providers)
264
- || {}
254
+ processed.relations.sports_data.providers) ||
255
+ {}
265
256
  ).forEach((providerId) => {
266
257
  const provider = processed.relations.sports_data.providers[providerId];
267
258
  const tracker = generateTrackerLink(provider, 'main');
@@ -279,7 +270,7 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
279
270
  component: require.resolve('./src/components/app.js'),
280
271
  context: {
281
272
  page: trackerPageObject,
282
- provider: provider,
273
+ provider,
283
274
  isTracker: true,
284
275
  },
285
276
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "2.2.6",
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' }}
@@ -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
  <>