first commit

This commit is contained in:
patarapolw committed 2019-08-12 01:13:27 +07:00
commit 379b9d1a62
24 files changed
+3828

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
const path = require("path");
const fs = require("fs");
module.exports = {
apply() {
cogear.on("build.page.writeAfter", ([page, html]) => {
let BASE_URL = cogear.config.baseUrl || "/";
html = html.replace(/(<link rel="stylesheet" href="|<script src=")\//g, `$1${BASE_URL}`);
page.writePath = path.join(cogear.options.output, page.path);
fs.writeFileSync(page.writePath, html);
})
}
}