You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
1.0 KiB
25 lines
1.0 KiB
import path from "path";
|
|
import {copyFile} from "fs/promises";
|
|
import {copy} from "fs-extra";
|
|
import {capitalize, getConfigs} from "../../helpers.js";
|
|
import {buildHubspotJSONFiles, createDistFolder,} from "./hubspot-email-adapter.js";
|
|
|
|
const {modulesPath, projectPath} = getConfigs();
|
|
|
|
export async function buildHubspotPage(blockName) {
|
|
const distPath = await createDistFolder(blockName);
|
|
|
|
const srcPath = path.join(projectPath, 'src');
|
|
await copyFile(path.join(srcPath, `${blockName}.template.hbs`), path.join(distPath, 'module.html'));
|
|
await copyFile(path.join(srcPath, 'styles', `${blockName}.min.css`), path.join(distPath, 'module.css'));
|
|
await copyFile(path.join(srcPath, 'scripts', `${blockName}.min.js`), path.join(distPath, 'module.js'));
|
|
await copy(path.join(projectPath, 'src', 'images'), path.join(distPath, 'images'));
|
|
|
|
await buildHubspotJSONFiles(distPath, {
|
|
global: false,
|
|
host_template_types: ["PAGE"],
|
|
label: capitalize(blockName),
|
|
is_available_for_new_content: true
|
|
});
|
|
}
|
|
|
|
|