mod-build 3.7.4 → 3.7.5
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 +4 -0
- package/gulp-tasks/grab-mhsadmin-data.js +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -194,7 +194,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
194
194
|
|
|
195
195
|
const _insertTrade = function(htmlString) {
|
|
196
196
|
const markup = gulpPlugins.htmlParser.parse(htmlString);
|
|
197
|
-
markup.querySelector('.btn--zip').setAttribute('data-service', trade.slug);
|
|
197
|
+
markup.querySelector('.btn--zip').setAttribute('data-service', trade.slug.toLowerCase().replaceAll(/[-|\s]/ig, '_'));
|
|
198
198
|
markup.querySelector('.trade').textContent = trade.displayName;
|
|
199
199
|
return markup;
|
|
200
200
|
};
|
|
@@ -247,20 +247,20 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
247
247
|
trade = '${trade}'
|
|
248
248
|
}}{{/page.articlesConfig.articlesWithContractors.${trade}.${pageName}}}`;
|
|
249
249
|
// make the directory by trade name
|
|
250
|
-
fs.mkdir(`${templatesPath}/${siteDetails.homepage}/${trade}/`, { recursive: true }, async function(error) {
|
|
250
|
+
fs.mkdir(`${templatesPath}/${siteDetails.homepage}/${articleData.data.trade.slug}/`, { recursive: true }, async function(error) {
|
|
251
251
|
if (error) {
|
|
252
252
|
throw error;
|
|
253
253
|
}
|
|
254
|
-
fs.writeFile(`${templatesPath}/${siteDetails.homepage}/${trade}/index.html`, tradeHubFileContent, function(err) {
|
|
254
|
+
fs.writeFile(`${templatesPath}/${siteDetails.homepage}/${articleData.data.trade.slug}/index.html`, tradeHubFileContent, function(err) {
|
|
255
255
|
if (err) {
|
|
256
256
|
throw err;
|
|
257
257
|
}
|
|
258
|
-
fs.writeFile(`${templatesPath}/${siteDetails.homepage}/${trade}/${fileName}.html`, fileContent, function($err) {
|
|
258
|
+
fs.writeFile(`${templatesPath}/${siteDetails.homepage}/${articleData.data.trade.slug}/${fileName}.html`, fileContent, function($err) {
|
|
259
259
|
if ($err) {
|
|
260
260
|
throw $err;
|
|
261
261
|
}
|
|
262
262
|
templatesCount++;
|
|
263
|
-
log.info(`Article template ${templatesCount?.toString()?.padStart(2, '0')}: ${templatesPath}${trade}/${siteDetails.homepage}/${fileName}.html`);
|
|
263
|
+
log.info(`Article template ${templatesCount?.toString()?.padStart(2, '0')}: ${templatesPath}${articleData.data.trade.slug}/${siteDetails.homepage}/${fileName}.html`);
|
|
264
264
|
if (articleConfigsCount === templatesCount) {
|
|
265
265
|
siteData.page.lastMod = formatDate(new Date().toLocaleDateString(dateLocalString, lastModDateOptions));
|
|
266
266
|
done();
|