gatsby-core-theme 1.6.14 → 1.6.18

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,49 @@
1
+ ## [1.6.18](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.17...v1.6.18) (2021-12-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add watchfooty prefix ([d7111a7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d7111a754744f8c765d56a068bc323eefcf996c4))
7
+ * added passive scrolling ([9098cb7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9098cb715400f38035bf29f2dc597f24d2b62672))
8
+ * configured touch events to be passive and added minify plugin ([cb73f96](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cb73f96a89a5c2bc07f7a85cc3e3233876d987ff))
9
+
10
+
11
+ ### Code Refactoring
12
+
13
+ * update schema author url ([1cf3346](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/1cf33462031e0d2cb540fcb9e6913a7cb5545f08))
14
+
15
+
16
+ * Merge branch 'tm-2589-update-schema-author-url' into 'master' ([40e8dbc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/40e8dbc0f3263dcecf012bfc3b3aa800c1dc7aff))
17
+ * Merge branch 'add_timezone_prefix' into 'master' ([cf13fc6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cf13fc69d6c896a018d58e96c7d0fc6721d5aef7))
18
+ * Merge branch 'tm-2558-passive-scroll' into 'master' ([741fff3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/741fff36ba62eb4f0d1d76821581d46c0a266293))
19
+
20
+ ## [1.6.17](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.16...v1.6.17) (2021-12-03)
21
+
22
+
23
+ ### Code Refactoring
24
+
25
+ * fix the getUrl build errors for rage sites ([7a56fcc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7a56fcc4ed6b84908b3c9cabc39871c8dd612ca0))
26
+
27
+
28
+ * Merge branch 'fix_path_error' into 'master' ([cbaeb02](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cbaeb02080991a4bb2f0e6e3cd50f4d977169509))
29
+
30
+ ## [1.6.16](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.15...v1.6.16) (2021-12-03)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * fix event hour format based on site name ([d1c275c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d1c275ccc5ed429f04208c1cf8ae4c5d4841aac7))
36
+
37
+
38
+ * Merge branch 'format_event_hour' into 'master' ([1b8c999](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/1b8c999064676973c55360cc04820f0be122496e))
39
+
40
+ ## [1.6.15](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.14...v1.6.15) (2021-12-02)
41
+
42
+
43
+ ### Bug Fixes
44
+
45
+ * html sitemap page translations ([3bd7093](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3bd70937dc819d9a98d951ce3946ba71c1ad7055))
46
+
1
47
  ## [1.6.14](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.13...v1.6.14) (2021-12-01)
2
48
 
3
49
 
package/gatsby-browser.js CHANGED
@@ -53,5 +53,5 @@ exports.onClientEntry = () => {
53
53
 
54
54
  document.addEventListener('scroll', initGTMOnEvent);
55
55
  document.addEventListener('mousemove', initGTMOnEvent);
56
- document.addEventListener('touchstart', initGTMOnEvent);
56
+ document.addEventListener('touchstart', initGTMOnEvent, { passive: true });
57
57
  };
package/gatsby-config.js CHANGED
@@ -3,6 +3,7 @@ module.exports = {
3
3
  DEV_SSR: false,
4
4
  },
5
5
  plugins: [
6
+ `gatsby-plugin-minify-html`,
6
7
  'gatsby-plugin-loadable-components-ssr',
7
8
  {
8
9
  resolve: 'gatsby-plugin-sass',
@@ -219,6 +219,7 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
219
219
  marketSections,
220
220
  prefilledModules,
221
221
  siteInfo,
222
+ translations,
222
223
  ...themeOptions,
223
224
  };
224
225
 
@@ -247,7 +248,6 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
247
248
  context: {
248
249
  ...contextData,
249
250
  siteSchema,
250
- translations,
251
251
  isPreview: page.path === 'preview',
252
252
  },
253
253
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "1.6.14",
3
+ "version": "1.6.18",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -36,6 +36,7 @@
36
36
  "gatsby-plugin-image": "^1.3.1",
37
37
  "gatsby-plugin-loadable-components-ssr": "^3.3.0",
38
38
  "gatsby-plugin-manifest": "^3.3.0",
39
+ "gatsby-plugin-minify-html": "^1.0.4",
39
40
  "gatsby-plugin-postcss": "^4.3.0",
40
41
  "gatsby-plugin-preact": "^5.13.0",
41
42
  "gatsby-plugin-react-helmet": "^4.3.0",
@@ -162,20 +162,20 @@ function Slider({
162
162
  sliderContentNode.addEventListener('mousedown', mousedown);
163
163
  document.addEventListener('mousemove', mouseMoveDebounce);
164
164
  document.addEventListener('mouseup', mouseUpDebounce);
165
- sliderContentNode.addEventListener('touchstart', mousedown);
166
- sliderContentNode.addEventListener('touchmove', mouseMoveDebounce);
165
+ sliderContentNode.addEventListener('touchstart', mousedown, { passive: true });
166
+ sliderContentNode.addEventListener('touchmove', mouseMoveDebounce, { passive: true });
167
167
  sliderContentNode.addEventListener('touchend', mouseUpDebounce);
168
- sliderContainerRef.current.addEventListener('wheel', onWheel);
168
+ sliderContainerRef.current.addEventListener('wheel', onWheel, { passive: true });
169
169
 
170
170
  return () => {
171
171
  sliderContentNode?.removeEventListener('click', click);
172
172
  sliderContentNode?.removeEventListener('mousedown', mousedown);
173
173
  document.removeEventListener('mousemove', mouseMoveDebounce);
174
174
  document.removeEventListener('mouseup', mouseUpDebounce);
175
- sliderContentNode?.removeEventListener('touchstart', mousedown);
176
- sliderContentNode?.removeEventListener('touchmove', mouseMoveDebounce);
175
+ sliderContentNode?.removeEventListener('touchstart', mousedown, { passive: true });
176
+ sliderContentNode?.removeEventListener('touchmove', mouseMoveDebounce, { passive: true });
177
177
  sliderContentNode?.removeEventListener('touchend', mouseUpDebounce);
178
- sliderContainerRef?.current?.removeEventListener('wheel', onWheel);
178
+ sliderContainerRef?.current?.removeEventListener('wheel', onWheel, { passive: true });
179
179
  };
180
180
  });
181
181
 
@@ -266,6 +266,10 @@ export function isTandcEnabled(extraFields) {
266
266
  }
267
267
 
268
268
  export function getUrl(path) {
269
+ if (!path) {
270
+ return '';
271
+ }
272
+
269
273
  if (path === '/') {
270
274
  return process.env.GATSBY_SITE_URL;
271
275
  }
@@ -6,9 +6,11 @@ import {
6
6
  filterEvents,
7
7
  findTournaments,
8
8
  getSortedEvents,
9
+ formatEvents,
9
10
  } from '../schedule';
10
11
 
11
12
  export function prepareSportsData(sportsData) {
13
+ sportsData.events = formatEvents(sportsData.events);
12
14
  Object.keys(sportsData.tournaments).forEach((key) => {
13
15
  if (sportsData.tournaments[key].events) {
14
16
  sportsData.tournaments[key].events = filterEvents(
@@ -120,3 +120,39 @@ export function filterEvents(tournamentEvents, events) {
120
120
 
121
121
  return futureEvents;
122
122
  }
123
+
124
+ export function changeEventHour(event, hour = 1) {
125
+ if (!event || !event.date || !event.date.time) {
126
+ return event;
127
+ }
128
+
129
+ const timeArr = event.date.time.split(':');
130
+ timeArr[0] = Number(timeArr[0]) - hour;
131
+ event.date.time = timeArr.join(':');
132
+
133
+ return event;
134
+ }
135
+
136
+ export function formatEvents(events) {
137
+ const eventsArr = Object.values(events);
138
+ const siteName = process.env.GATSBY_SITE_NAME;
139
+ let prefix = '0';
140
+
141
+ switch (siteName) {
142
+ case 'sefodbold.dk':
143
+ case 'sesport.dk':
144
+ case 'watchfooty.co.uk':
145
+ case 'bekijksport.nl':
146
+ case 'livestreamsvoetbal.nl':
147
+ prefix = 1;
148
+ break;
149
+ default:
150
+ prefix = 0;
151
+ }
152
+
153
+ return eventsArr.reduce((acc, current) => {
154
+ const event = changeEventHour(current, prefix);
155
+ acc[event.id] = event;
156
+ return acc;
157
+ }, {});
158
+ }
@@ -128,7 +128,7 @@ export function webPageSchema(page, pageImage) {
128
128
  contactType: 'Author',
129
129
  name: author.name || '',
130
130
  email: author.email_address || '',
131
- url: `${getUrl('/')}${author.profile_page_path}`,
131
+ url: getUrl(author.profile_page_path || '/'),
132
132
  })),
133
133
  sameAs: socialLinks
134
134
  .map((socialLink) => page.siteSchema?.[socialLink])
@@ -216,7 +216,7 @@ export function templateSchemas(page) {
216
216
  author: {
217
217
  '@type': 'Person',
218
218
  name: page.author?.name?.substring(0, 100),
219
- url: `${getUrl('/')}${page.author?.profile_page_path}`,
219
+ url: getUrl(page.author?.profile_page_path || '/'),
220
220
  },
221
221
  publisher: {
222
222
  '@type': 'Organization',
@@ -247,7 +247,7 @@ export function templateSchemas(page) {
247
247
  author: {
248
248
  '@type': 'Person',
249
249
  name: page.author?.name?.substring(0, 100),
250
- url: `${getUrl('/')}${page.author?.profile_page_path}`,
250
+ url: getUrl(page.author?.profile_page_path || '/'),
251
251
  },
252
252
  publisher: {
253
253
  '@type': 'Organization',
@@ -289,7 +289,7 @@ export function templateSchemas(page) {
289
289
  author: {
290
290
  '@type': 'Person',
291
291
  name: page.author?.name?.substring(0, 100),
292
- url: `${getUrl('/')}${page.author?.profile_page_path}`,
292
+ url: getUrl(page.author?.profile_page_path || '/'),
293
293
  },
294
294
  publisher: {
295
295
  '@type': 'Organization',