@openstack_dev/gatsby-theme-marketing-oif-core 1.0.25 → 1.0.26
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 +0 -33
- package/package.json +1 -1
package/gatsby-node.js
CHANGED
|
@@ -15,7 +15,6 @@ const {
|
|
|
15
15
|
MAINTENANCE_FILE_PATH,
|
|
16
16
|
FONTS_SCSS_FILE_PATH,
|
|
17
17
|
SPONSORED_PROJECTS_FILE_PATH,
|
|
18
|
-
FOOTER_FILE_PATH,
|
|
19
18
|
} = require("./src/utils/filePath");
|
|
20
19
|
const { generateFontFile } = require("./src/utils/cssUtils");
|
|
21
20
|
|
|
@@ -88,38 +87,6 @@ exports.onPreBootstrap = async () => {
|
|
|
88
87
|
if (sponsoredProjects) {
|
|
89
88
|
writeToJson(SPONSORED_PROJECTS_FILE_PATH, sponsoredProjects);
|
|
90
89
|
}
|
|
91
|
-
|
|
92
|
-
// new footer structure migration
|
|
93
|
-
// read the JSON file
|
|
94
|
-
const rawData = fs.readFileSync(FOOTER_FILE_PATH, "utf8");
|
|
95
|
-
let footerJSON;
|
|
96
|
-
try {
|
|
97
|
-
footerJSON = JSON.parse(rawData);
|
|
98
|
-
} catch (error) {
|
|
99
|
-
console.log("Error parsing JSON from footer file:", error);
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
// return new structure for social networks
|
|
103
|
-
if (footerJSON.social && Array.isArray(footerJSON.social.networks)) {
|
|
104
|
-
footerJSON.social.networks = footerJSON.social.networks.map((item) => ({
|
|
105
|
-
display: item.display,
|
|
106
|
-
title: item.title || item.icon,
|
|
107
|
-
clickBehaviour: {
|
|
108
|
-
link: item.clickBehaviour?.link || item.link,
|
|
109
|
-
attributes: item.clickBehaviour?.attributes || [],
|
|
110
|
-
},
|
|
111
|
-
rendering: {
|
|
112
|
-
icon: item.rendering?.icon || item.icon,
|
|
113
|
-
},
|
|
114
|
-
}));
|
|
115
|
-
}
|
|
116
|
-
// save updated file.
|
|
117
|
-
try {
|
|
118
|
-
fs.writeFileSync(FOOTER_FILE_PATH, JSON.stringify(footerJSON));
|
|
119
|
-
console.log(`File successfully updated at ${FOOTER_FILE_PATH}`);
|
|
120
|
-
} catch (error) {
|
|
121
|
-
console.log("Error writing updated config file:", error);
|
|
122
|
-
}
|
|
123
90
|
};
|
|
124
91
|
|
|
125
92
|
exports.createSchemaCustomization = ({ actions }) => {
|