@griddo/cx 1.75.0 → 1.75.2
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 +2 -0
- package/package.json +3 -3
- package/src/components/seo.js +9 -4
- package/src/utils/helpers.js +3 -3
- package/src/utils/pages.js +3 -3
package/gatsby-node.js
CHANGED
|
@@ -129,6 +129,7 @@ exports.createPages = async ({ actions }) => {
|
|
|
129
129
|
useMetaTitle,
|
|
130
130
|
showBasicMetaRobots,
|
|
131
131
|
avoidHrefLangsOnCanonicals,
|
|
132
|
+
avoidSelfReferenceCanonicals,
|
|
132
133
|
} = SettingsService.settings;
|
|
133
134
|
|
|
134
135
|
NavService.navigations = {
|
|
@@ -166,6 +167,7 @@ exports.createPages = async ({ actions }) => {
|
|
|
166
167
|
useMetaTitle,
|
|
167
168
|
showBasicMetaRobots,
|
|
168
169
|
avoidHrefLangsOnCanonicals,
|
|
170
|
+
avoidSelfReferenceCanonicals,
|
|
169
171
|
},
|
|
170
172
|
BUILD_MODE,
|
|
171
173
|
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.2",
|
|
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.2",
|
|
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": "f2d7e58bd884b6fb5472d1127975fd806f936e17"
|
|
101
101
|
}
|
package/src/components/seo.js
CHANGED
|
@@ -25,6 +25,7 @@ export default function SEO(props) {
|
|
|
25
25
|
useMetaTitle,
|
|
26
26
|
showBasicMetaRobots,
|
|
27
27
|
avoidHrefLangsOnCanonicals,
|
|
28
|
+
avoidSelfReferenceCanonicals,
|
|
28
29
|
},
|
|
29
30
|
} = props;
|
|
30
31
|
|
|
@@ -62,16 +63,20 @@ export default function SEO(props) {
|
|
|
62
63
|
// else (Cloudinary or unkonwn) returns the original favicon url.
|
|
63
64
|
const faviconResized = addGriddoDamParams(favicon, 'f/png/w/32/h/32');
|
|
64
65
|
|
|
66
|
+
// Validate options
|
|
67
|
+
const useCanonical = !!canonical && !(avoidSelfReferenceCanonicals && canonical === fullUrl);
|
|
68
|
+
const useHrefLangs = !(avoidHrefLangsOnCanonicals && useCanonical) && index === 'index' && pageLanguages?.length > 1;
|
|
69
|
+
|
|
65
70
|
return (
|
|
66
71
|
<>
|
|
67
72
|
<Helmet title={title}>
|
|
68
73
|
<meta name="description" content={description} />
|
|
69
74
|
{useMetaTitle && <meta name="title" content={title} />}
|
|
70
|
-
{
|
|
75
|
+
{useCanonical && <link rel="canonical" href={canonical} />}
|
|
71
76
|
<link rel="icon" href={faviconResized} />
|
|
72
77
|
|
|
73
78
|
{/* Alternate, solo si se indexa la página y tiene traducciones */}
|
|
74
|
-
{
|
|
79
|
+
{useHrefLangs &&
|
|
75
80
|
pageLanguages
|
|
76
81
|
.filter(item => item.isLive)
|
|
77
82
|
.map(item => (
|
|
@@ -91,16 +96,16 @@ export default function SEO(props) {
|
|
|
91
96
|
<meta property="og:locale" content={locale} />
|
|
92
97
|
<meta property="og:title" content={openGraph.title || title} />
|
|
93
98
|
<meta property="og:type" content={openGraph.type || 'website'} />
|
|
94
|
-
<meta property="og:url" content={canonical || fullUrl} />
|
|
95
99
|
<meta property="og:description" content={openGraph.description} />
|
|
96
100
|
<meta property="og:image" content={openGraph.image} />
|
|
101
|
+
<meta property="og:url" content={canonical || fullUrl} />
|
|
97
102
|
|
|
98
103
|
{/* Twitter */}
|
|
99
104
|
<meta property="twitter:card" content="summary_large_image" />
|
|
100
|
-
<meta property="twitter:url" content={canonical || fullUrl} />
|
|
101
105
|
<meta property="twitter:title" content={openGraph.title || title} />
|
|
102
106
|
<meta property="twitter:description" content={openGraph.description} />
|
|
103
107
|
<meta property="twitter:image" content={openGraph.twitterImage} />
|
|
108
|
+
<meta property="twitter:url" content={canonical || fullUrl} />
|
|
104
109
|
|
|
105
110
|
{/* Lang */}
|
|
106
111
|
<html lang={locale} />
|
package/src/utils/helpers.js
CHANGED
|
@@ -55,11 +55,11 @@ const getPageMetaData = params => {
|
|
|
55
55
|
|| [];
|
|
56
56
|
|
|
57
57
|
return {
|
|
58
|
-
title: metaTitle || title,
|
|
58
|
+
title: (metaTitle || title || '').trim(),
|
|
59
59
|
description: metaDescription,
|
|
60
60
|
canonical:
|
|
61
|
-
canonicalURL && canonicalURL !== fullUrl
|
|
62
|
-
? canonicalURL
|
|
61
|
+
(canonicalURL && canonicalURL.trim() && canonicalURL !== fullUrl)
|
|
62
|
+
? canonicalURL.trim()
|
|
63
63
|
: isIndexed
|
|
64
64
|
? fullUrl
|
|
65
65
|
: null,
|
package/src/utils/pages.js
CHANGED
|
@@ -94,7 +94,7 @@ async function renderSinglePage(page, additionalInfo, createPage) {
|
|
|
94
94
|
|
|
95
95
|
if (assetPrefix) mappedPage.matchPath = fullPath.compose;
|
|
96
96
|
|
|
97
|
-
createPage(mappedPage);
|
|
97
|
+
await createPage(mappedPage);
|
|
98
98
|
|
|
99
99
|
const exportFile = path.resolve(
|
|
100
100
|
__dirname,
|
|
@@ -126,7 +126,7 @@ async function renderListPages(
|
|
|
126
126
|
additionalInfo,
|
|
127
127
|
createPage
|
|
128
128
|
) {
|
|
129
|
-
await pages.forEach((dataInPage, idx) => {
|
|
129
|
+
await pages.forEach(async(dataInPage, idx) => {
|
|
130
130
|
const isFirstPage = idx === 0;
|
|
131
131
|
const pageNumber = idx + 1;
|
|
132
132
|
const { domainUrl, compose } = rootPage.fullPath;
|
|
@@ -153,7 +153,7 @@ async function renderListPages(
|
|
|
153
153
|
isRoot,
|
|
154
154
|
defaultLang,
|
|
155
155
|
};
|
|
156
|
-
renderSinglePage(paginatedPage, additionalInfo, createPage);
|
|
156
|
+
await renderSinglePage(paginatedPage, additionalInfo, createPage);
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
|