1st request #1

Merged
dtomlinson merged 70 commits from develop into master 2020-06-04 16:46:03 +00:00
2 changed files with 19 additions and 2 deletions
Showing only changes of commit b183117560 - Show all commits

View File

@@ -2,7 +2,8 @@ const { run } = require("./build-lunrjs-index");
const gulp = require("gulp");
const util = require("util");
const execFile = util.promisify(require("child_process").execFile);
// const execFile = require("child_process").execFile;
const exec = util.promisify(require("child_process").exec);
const { getCurrentDir } = require("./utils");
async function buildSearch(cb) {
return run();
@@ -12,8 +13,17 @@ async function buildHugo(cb) {
await execFile("hugo", ["-D", "--minify"]);
}
async function buildTheme(cb) {
var themeDir = getCurrentDir(__dirname) + "/themes/panaetius-theme";
console.log(themeDir);
await exec(
`cd ${themeDir} && node ${themeDir}/node_modules/webpack/bin/webpack.js --config ${themeDir}/webpack.prod.js`
);
}
module.exports = {
buildSearch: buildSearch,
buildHugo: buildHugo,
buildBlog: gulp.parallel([buildSearch, buildHugo]),
buildTheme: buildTheme,
buildBlog: gulp.parallel([buildSearch, buildHugo, buildTheme]),
};

View File

@@ -0,0 +1,7 @@
function getCurrentDir(dir) {
var themeDir = dir.split("/");
themeDir.pop();
return themeDir.join("/");
}
exports.getCurrentDir = getCurrentDir