@griddo/cx 1.75.43 → 1.75.44

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/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.43",
4
+ "version": "1.75.44",
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.43",
68
+ "@griddo/eslint-config-back": "^1.75.44",
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": "252008432418d6272851f7ca6d21eefb17d568a6"
100
+ "gitHead": "cdb6489176361629d0a7526befdca249ed8117d5"
101
101
  }
@@ -19,7 +19,8 @@ const log = (state, message, data) => {
19
19
  LOGS !== false &&
20
20
  state !== 'error' &&
21
21
  console.log(
22
- `${chalk[color[state]](msg[state])} ${message} ${data ? JSON.stringify(data, null, 2) : ''
22
+ `${chalk[color[state]](msg[state])} ${message} ${
23
+ data ? JSON.stringify(data, null, 2) : ''
23
24
  }`
24
25
  );
25
26
  };
@@ -28,15 +29,18 @@ const log = (state, message, data) => {
28
29
  const formatImage = (image, width, height, format = 'jpg') => {
29
30
  const url = image?.url || image;
30
31
  if (!url) return null;
31
- return url.split('/')[2].includes('cloudinary.com')
32
- ? addCloudinaryParams(url, `c_fill,w_${width},h_${height}`)
33
- : addGriddoDamParams(url, `f/${format}/w/${width}/h/${height}`);
32
+ const isCloudinary = url.split('/')[2].includes('cloudinary.com');
33
+ isCloudinary
34
+ ? addCloudinaryParams(url, `c_fill,w_${width},h_${height}`)
35
+ : addGriddoDamParams(url, `f/${format}/w/${width}/h/${height}`);
34
36
  };
35
37
 
36
38
  // Format Griddo DAM image
37
39
  const addGriddoDamParams = (image, params) => {
38
40
  const splittedUrl = image.split('/');
39
- return `${splittedUrl.slice(0,-1).join('/')}/${params}/${splittedUrl.slice(-1)[0]}`;
41
+ return `${splittedUrl.slice(0, -1).join('/')}/${params}/${
42
+ splittedUrl.slice(-1)[0]
43
+ }`;
40
44
  };
41
45
 
42
46
  // Take a cloudinary url and add query params
@@ -62,27 +66,29 @@ const getPageMetaData = params => {
62
66
  fullUrl,
63
67
  } = params;
64
68
 
65
- const metasAdvancedList = metasAdvanced
66
- ?.split(',')
67
- .filter(item => !!item)
68
- .map(item => item.trim().toLowerCase())
69
- || [];
69
+ const metasAdvancedList =
70
+ metasAdvanced
71
+ ?.split(',')
72
+ .filter(item => !!item)
73
+ .map(item => item.trim().toLowerCase()) || [];
70
74
 
71
75
  return {
72
76
  title: (metaTitle || title || '').trim(),
73
77
  description: metaDescription,
74
78
  canonical:
75
- (canonicalURL && canonicalURL.trim() && canonicalURL !== fullUrl)
79
+ canonicalURL && canonicalURL.trim() && canonicalURL !== fullUrl
76
80
  ? canonicalURL.trim()
77
81
  : isIndexed
78
- ? fullUrl
79
- : null,
82
+ ? fullUrl
83
+ : null,
80
84
  locale,
81
85
  url,
82
86
  index: isIndexed ? 'index' : 'noindex',
83
87
  follow: follow ? 'follow' : 'nofollow',
84
88
  translate: metasAdvancedList.includes('notranslate') ? 'notranslate' : '',
85
- metasAdvanced: metasAdvancedList.filter(item => item !== 'notranslate').join(),
89
+ metasAdvanced: metasAdvancedList
90
+ .filter(item => item !== 'notranslate')
91
+ .join(),
86
92
  pageLanguages,
87
93
  };
88
94
  };
@@ -96,7 +102,7 @@ const getOpenGraph = ({
96
102
  type: 'website',
97
103
  title: socialTitle || title,
98
104
  description: socialDescription,
99
- image: formatImage(socialImage, 1280,768),
105
+ image: formatImage(socialImage, 1280, 768),
100
106
  twitterImage: formatImage(socialImage, 1280, 768),
101
107
  });
102
108