@griddo/cx 1.75.32 → 1.75.33
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/gatsby-node.js +7 -1
- package/package.json +3 -3
- package/src/components/template.js +6 -3
- package/src/utils/package.js +11 -5
- package/src/utils/pages.js +2 -0
package/gatsby-node.js
CHANGED
|
@@ -29,7 +29,10 @@ const BUILD_MODE = process.env.CXBRANCH;
|
|
|
29
29
|
let updatedSites;
|
|
30
30
|
let createdPages = [];
|
|
31
31
|
let buildProcessData = {};
|
|
32
|
-
const
|
|
32
|
+
const {
|
|
33
|
+
componentsVersion,
|
|
34
|
+
griddoVersion,
|
|
35
|
+
} = getComponentsVersion();
|
|
33
36
|
|
|
34
37
|
const renderId = process.env.RENDERID || new Date().valueOf();
|
|
35
38
|
|
|
@@ -130,6 +133,7 @@ exports.createPages = async ({ actions }) => {
|
|
|
130
133
|
showBasicMetaRobots,
|
|
131
134
|
avoidHrefLangsOnCanonicals,
|
|
132
135
|
avoidSelfReferenceCanonicals,
|
|
136
|
+
avoidDebugMetas,
|
|
133
137
|
} = SettingsService.settings;
|
|
134
138
|
|
|
135
139
|
NavService.navigations = {
|
|
@@ -163,11 +167,13 @@ exports.createPages = async ({ actions }) => {
|
|
|
163
167
|
siteLangs,
|
|
164
168
|
cloudinaryName,
|
|
165
169
|
componentsVersion,
|
|
170
|
+
griddoVersion,
|
|
166
171
|
siteOptions: {
|
|
167
172
|
useMetaTitle,
|
|
168
173
|
showBasicMetaRobots,
|
|
169
174
|
avoidHrefLangsOnCanonicals,
|
|
170
175
|
avoidSelfReferenceCanonicals,
|
|
176
|
+
avoidDebugMetas,
|
|
171
177
|
},
|
|
172
178
|
BUILD_MODE,
|
|
173
179
|
siteScript,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/cx",
|
|
3
3
|
"description": "Griddo SSG based on Gatsby",
|
|
4
|
-
"version": "1.75.
|
|
4
|
+
"version": "1.75.33",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"react-helmet": "^6.0.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@griddo/eslint-config-back": "^1.75.
|
|
68
|
+
"@griddo/eslint-config-back": "^1.75.33",
|
|
69
69
|
"eslint": "^7.5.0",
|
|
70
70
|
"eslint-plugin-node": "^11.1.0",
|
|
71
71
|
"eslint-plugin-react": "7.14.3",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"publishConfig": {
|
|
98
98
|
"access": "public"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "8fd3e9c38978faee9d3860c4f2613423bc59e117"
|
|
101
101
|
}
|
|
@@ -32,6 +32,8 @@ export const Head = ({ pageContext }) => {
|
|
|
32
32
|
openGraph,
|
|
33
33
|
analyticsDimensions,
|
|
34
34
|
analyticsScript,
|
|
35
|
+
componentsVersion,
|
|
36
|
+
griddoVersion,
|
|
35
37
|
page: {
|
|
36
38
|
fullUrl,
|
|
37
39
|
},
|
|
@@ -86,7 +88,7 @@ export const Head = ({ pageContext }) => {
|
|
|
86
88
|
siteOptions?.avoidSelfReferenceCanonicals &&
|
|
87
89
|
pageMetadata?.canonical === fullUrl
|
|
88
90
|
);
|
|
89
|
-
|
|
91
|
+
|
|
90
92
|
const useHrefLangs =
|
|
91
93
|
!(
|
|
92
94
|
siteOptions?.avoidHrefLangsOnCanonicals &&
|
|
@@ -133,7 +135,7 @@ export const Head = ({ pageContext }) => {
|
|
|
133
135
|
content={openGraph?.title || pageMetadata?.title}
|
|
134
136
|
/>}
|
|
135
137
|
<meta property="og:type" content={openGraph?.type || 'website'} />
|
|
136
|
-
{!!openGraph?.description && <meta property="og:description" content={openGraph?.description} />}
|
|
138
|
+
{(!!openGraph?.description || !!pageMetadata?.description) && <meta property="og:description" content={openGraph?.description || pageMetadata?.description} />}
|
|
137
139
|
{!!openGraph?.image && <meta property="og:image" content={openGraph?.image} />}
|
|
138
140
|
<meta property="og:url" content={pageMetadata?.canonical || fullUrl} />
|
|
139
141
|
|
|
@@ -143,12 +145,13 @@ export const Head = ({ pageContext }) => {
|
|
|
143
145
|
property="twitter:title"
|
|
144
146
|
content={openGraph?.title || pageMetadata?.title}
|
|
145
147
|
/>}
|
|
146
|
-
{!!openGraph?.description && <meta property="twitter:description" content={openGraph?.description} />}
|
|
148
|
+
{(!!openGraph?.description || pageMetadata?.description) && <meta property="twitter:description" content={openGraph?.description || pageMetadata?.description} />}
|
|
147
149
|
{(!!openGraph?.twitterImage || !!openGraph?.image) && <meta property="twitter:image" content={openGraph?.twitterImage || openGraph?.image} />}
|
|
148
150
|
<meta
|
|
149
151
|
property="twitter:url"
|
|
150
152
|
content={pageMetadata?.canonical || fullUrl}
|
|
151
153
|
/>
|
|
154
|
+
{!siteOptions?.avoidDebugMetas && <meta property="debug" content={`Components v${componentsVersion} by Griddo v${griddoVersion} @ ${new Date()}`} />}
|
|
152
155
|
|
|
153
156
|
{/* Data Layer */}
|
|
154
157
|
{/* Solo cuando se ejecuta en el navegador */}
|
package/src/utils/package.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
const
|
|
1
|
+
const packageInfo = require('../../package.json');
|
|
2
2
|
|
|
3
3
|
const getComponentsVersion = () => {
|
|
4
4
|
const {
|
|
5
|
-
dependencies
|
|
6
|
-
|
|
5
|
+
dependencies,
|
|
6
|
+
version,
|
|
7
|
+
} = packageInfo;
|
|
8
|
+
|
|
7
9
|
const componentsKey = dependencies.components ? 'components' : Object.keys(dependencies).find(key => key.endsWith('/components'));
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
+
const componentsVersion = componentsKey ? dependencies[componentsKey] : '0.0.0';
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
componentsVersion: componentsVersion.split('^').join('').split('@').slice(-1)[0],
|
|
14
|
+
griddoVersion: version,
|
|
15
|
+
};
|
|
10
16
|
};
|
|
11
17
|
|
|
12
18
|
module.exports = {
|
package/src/utils/pages.js
CHANGED
|
@@ -25,6 +25,7 @@ async function renderSinglePage(page, additionalInfo, createPage) {
|
|
|
25
25
|
cloudinaryName,
|
|
26
26
|
siteOptions,
|
|
27
27
|
componentsVersion,
|
|
28
|
+
griddoVersion,
|
|
28
29
|
BUILD_MODE,
|
|
29
30
|
sitePages,
|
|
30
31
|
siteScript,
|
|
@@ -75,6 +76,7 @@ async function renderSinglePage(page, additionalInfo, createPage) {
|
|
|
75
76
|
siteOptions,
|
|
76
77
|
BUILD_MODE,
|
|
77
78
|
componentsVersion,
|
|
79
|
+
griddoVersion,
|
|
78
80
|
sitePages,
|
|
79
81
|
siteScript,
|
|
80
82
|
|