gatsby-matrix-theme 53.16.5 → 53.17.1
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 +21 -0
- package/package.json +1 -1
- package/src/components/atoms/verification-badge/template-one/index.js +15 -11
- package/src/gatsby-core-theme/helpers/schema.js +111 -4
- package/storybook/public/{251.5de6526b.iframe.bundle.js → 251.4c56b7d7.iframe.bundle.js} +3 -3
- package/storybook/public/{251.5de6526b.iframe.bundle.js.map → 251.4c56b7d7.iframe.bundle.js.map} +1 -1
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.ee78e451.iframe.bundle.js +1 -0
- package/storybook/public/project.json +1 -1
- package/storybook/public/main.c46dfa87.iframe.bundle.js +0 -1
- /package/storybook/public/{251.5de6526b.iframe.bundle.js.LICENSE.txt → 251.4c56b7d7.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [53.17.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.17.0...v53.17.1) (2026-05-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add month translations on verification badge text ([23ec9e4](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/23ec9e44bbeaff9ca0d2f60f19781fee9166affc))
|
|
7
|
+
* remove console log ([df44cbf](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/df44cbf38b36918f96326702e4a1f7b1e671ee30))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
* Merge branch 'verification-month-translations' into 'master' ([abc5654](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/abc5654df0431b962cc360dcaa388a56e146fb26))
|
|
11
|
+
|
|
12
|
+
# [53.17.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.16.5...v53.17.0) (2026-05-11)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
* Merge branch 'en-501-update-schema-output' into 'master' ([a2b314a](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/a2b314acca53998cd00c4ce1aae5465ab99c6769))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* update schema output ([567b828](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/567b828497ce8ffd12d57c45fa1db9bfedf4fd8d))
|
|
21
|
+
|
|
1
22
|
## [53.16.5](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.16.4...v53.16.5) (2026-05-06)
|
|
2
23
|
|
|
3
24
|
|
package/package.json
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { classNames } from '@gigmedia/enigma-utils';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import {
|
|
4
|
+
import { months } from 'gatsby-core-theme/src/constants/common.mjs';
|
|
5
5
|
import useTranslate from '~hooks/useTranslate/useTranslate';
|
|
6
6
|
import styles from './verification-badge.module.scss';
|
|
7
7
|
import VerifyIcon from '../../../../images/icons/verified-author';
|
|
8
8
|
|
|
9
|
-
const VerificationBadge = ({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
const VerificationBadge = ({ text, icon = <VerifyIcon color="#3B82F6" />, extraClass }) => {
|
|
10
|
+
const month = new Date().getMonth();
|
|
11
|
+
const defaultText = `${useTranslate('verified_on', 'Verified on')} ${useTranslate(
|
|
12
|
+
months[month],
|
|
13
|
+
months[month]
|
|
14
|
+
)}`;
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className={classNames([styles.badgeContainer, extraClass])}>
|
|
18
|
+
{icon}
|
|
19
|
+
{text ?? defaultText}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
19
23
|
|
|
20
24
|
VerificationBadge.propTypes = {
|
|
21
25
|
text: PropTypes.string,
|
|
@@ -4,8 +4,13 @@ import {
|
|
|
4
4
|
webPageSchema,
|
|
5
5
|
organizationSchema,
|
|
6
6
|
moduleSchemas,
|
|
7
|
-
|
|
7
|
+
customSchema,
|
|
8
|
+
getAuthors,
|
|
9
|
+
generateSchemaObject,
|
|
10
|
+
prosAndConsData,
|
|
8
11
|
} from 'gatsby-core-theme/src/helpers/schema';
|
|
12
|
+
import { getGameRating, getUrl, imagePrettyUrl } from 'gatsby-core-theme/src/helpers/getters';
|
|
13
|
+
import { SchemaConstant } from 'gatsby-core-theme/src/constants/schema';
|
|
9
14
|
|
|
10
15
|
const knowsAbout = [
|
|
11
16
|
{
|
|
@@ -41,18 +46,120 @@ const knowsAbout = [
|
|
|
41
46
|
],
|
|
42
47
|
},
|
|
43
48
|
];
|
|
49
|
+
export function templateSchemas(page, pageImage) {
|
|
50
|
+
const sharedProps = {
|
|
51
|
+
author: getAuthors(page),
|
|
52
|
+
datePublished: page?.manual_published_date || page?.created_at,
|
|
53
|
+
dateModified: page?.manual_updated_date || page?.updated_at,
|
|
54
|
+
publisher: {
|
|
55
|
+
'@type': 'Organization',
|
|
56
|
+
name:
|
|
57
|
+
page.siteSchema?.owned_by ||
|
|
58
|
+
customSchema[process.env.GATSBY_SITE_NAME] ||
|
|
59
|
+
page.siteInfo?.site_name ||
|
|
60
|
+
process.env.GATSBY_SITE_NAME,
|
|
61
|
+
logo:
|
|
62
|
+
(page.siteInfo?.site_logo && `${process.env.IMAGE_CDN_URL}/${page.siteInfo.site_logo}`) ||
|
|
63
|
+
page.featured_image_object?.url ||
|
|
64
|
+
pageImage,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
switch (page.relation_type) {
|
|
68
|
+
case 'article': {
|
|
69
|
+
const schema = {
|
|
70
|
+
'@context': 'https://schema.org',
|
|
71
|
+
'@type': 'Article',
|
|
72
|
+
'@id': `${getUrl(page.path)}#article`,
|
|
73
|
+
url: getUrl(page.path),
|
|
74
|
+
headline: page.title,
|
|
75
|
+
mainEntityOfPage: {
|
|
76
|
+
'@type': 'WebPage',
|
|
77
|
+
url: process.env.GATSBY_SITE_URL,
|
|
78
|
+
},
|
|
79
|
+
...sharedProps,
|
|
80
|
+
};
|
|
44
81
|
|
|
82
|
+
return JSON.stringify(generateSchemaObject(schema));
|
|
83
|
+
}
|
|
84
|
+
case 'operator': {
|
|
85
|
+
const schema = {
|
|
86
|
+
'@context': 'https://schema.org',
|
|
87
|
+
'@type': 'Review',
|
|
88
|
+
'@id': `${getUrl(page.path)}#review`,
|
|
89
|
+
...prosAndConsData(page),
|
|
90
|
+
name: page.relation?.name || '',
|
|
91
|
+
reviewBody: page.extra_fields?.operator_summary || '',
|
|
92
|
+
itemReviewed: {
|
|
93
|
+
'@type': 'Organization',
|
|
94
|
+
url: getUrl(page.path),
|
|
95
|
+
name: page.title || '',
|
|
96
|
+
image: imagePrettyUrl(
|
|
97
|
+
page.relation?.logo?.filename,
|
|
98
|
+
SchemaConstant.operatorHeaderWidth,
|
|
99
|
+
SchemaConstant.operatorHeaderHeight
|
|
100
|
+
),
|
|
101
|
+
},
|
|
102
|
+
reviewRating: {
|
|
103
|
+
'@type': 'Rating',
|
|
104
|
+
bestRating: '5',
|
|
105
|
+
worstRating: '0',
|
|
106
|
+
ratingValue: page.relation?.rating?.toString() || '',
|
|
107
|
+
},
|
|
108
|
+
...sharedProps,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return JSON.stringify(generateSchemaObject(schema));
|
|
112
|
+
}
|
|
113
|
+
case 'game': {
|
|
114
|
+
const rating = Math.floor(getGameRating(page.relation) * 2);
|
|
115
|
+
const schema = {
|
|
116
|
+
'@context': 'https://schema.org',
|
|
117
|
+
'@type': 'VideoGame',
|
|
118
|
+
'@id': `${getUrl(page.path)}#videogame`,
|
|
119
|
+
url: getUrl(page.path),
|
|
120
|
+
name: page.relation?.name || '',
|
|
121
|
+
description: page.extra_fields?.game_summary || '',
|
|
122
|
+
operatingSystem: 'Multi-platform',
|
|
123
|
+
applicationCategory: ['Game'],
|
|
124
|
+
author: {
|
|
125
|
+
'@type': 'Organization',
|
|
126
|
+
name: process.env.GATSBY_SITE_NAME,
|
|
127
|
+
url: process.env.GATSBY_SITE_URL,
|
|
128
|
+
},
|
|
129
|
+
review: {
|
|
130
|
+
'@type': 'Review',
|
|
131
|
+
...prosAndConsData(page),
|
|
132
|
+
name: page.relation?.name || '',
|
|
133
|
+
reviewRating: {
|
|
134
|
+
'@type': 'Rating',
|
|
135
|
+
bestRating: '10',
|
|
136
|
+
worstRating: '0',
|
|
137
|
+
ratingValue: rating?.toString() || '',
|
|
138
|
+
},
|
|
139
|
+
...sharedProps,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
return JSON.stringify(generateSchemaObject(schema));
|
|
144
|
+
}
|
|
145
|
+
default:
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
45
149
|
export function schemaGenerator(page = {}, pageImage) {
|
|
46
150
|
const isNSA = process.env.GATSBY_SITE_NAME === 'norskespilleautomater.com';
|
|
47
151
|
const isHomepage = page.path === '/';
|
|
48
|
-
const tracker = page?.template === 'tracker';
|
|
152
|
+
const tracker = page?.template === 'tracker';
|
|
49
153
|
if (isNSA) {
|
|
50
154
|
page.knowsAbout = knowsAbout;
|
|
51
155
|
}
|
|
52
|
-
|
|
156
|
+
const includeWebpageSchemaInAllPages =
|
|
157
|
+
process.env.GATSBY_INCLUDE_WEBPAGE_SCHEMA_IN_ALL_PAGES === 'true';
|
|
53
158
|
// Temporary Change for removing webPageSchema
|
|
54
159
|
const hasWebPageSchema =
|
|
55
|
-
(page.relation_type !== 'operator' && page.relation_type !== 'game') ||
|
|
160
|
+
(page.relation_type !== 'operator' && page.relation_type !== 'game') ||
|
|
161
|
+
isNSA ||
|
|
162
|
+
includeWebpageSchemaInAllPages;
|
|
56
163
|
const hasOrganisationSchema = page.path === '/' || page.path === 'about-us';
|
|
57
164
|
const jsonSchema = [
|
|
58
165
|
// Page Schema
|